docker

package
v1.39.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 10, 2020 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const DockerLoginFailureMessage string = "Docker login failed for: %s.\nDocker image must be in the form: docker-registry-domain/path-in-repository/image-name:version."

Docker login error message

View Source
const MinSupportedApiVersion string = "1.31"

Docker API version 1.31 is compatible with Docker version 17.07.0, according to https://docs.docker.com/engine/api/#api-version-matrix

Variables

View Source
var ApiVersionRegex = regexp.MustCompile(`^(\d+)\.(\d+)$`)

Search for docker API version format pattern e.g. 1.40

Functions

func CreateServiceManager

func CreateServiceManager(artDetails *config.ArtifactoryDetails, threads int) (*artifactory.ArtifactoryServicesManager, error)

func DockerLogin

func DockerLogin(imageTag string, config *DockerLoginConfig) error

First will try to login assuming a proxy-less tag (e.g. "registry-address/docker-repo/image:ver"). If fails, we will try assuming a reverse proxy tag (e.g. "registry-address-docker-repo/image:ver").

func IsCompatibleApiVersion

func IsCompatibleApiVersion(dockerOutput string) bool

func ResolveRegistryFromTag

func ResolveRegistryFromTag(imageTag string) (string, error)

Get docker registry from tag

func ValidateClientApiVersion

func ValidateClientApiVersion() error

Types

type Builder

type Builder interface {
	Build(module string) (*buildinfo.BuildInfo, error)
}

Docker image build info builder.

func NewBuildInfoBuilder

func NewBuildInfoBuilder(image Image, repository, buildName, buildNumber string, serviceManager *artifactory.ArtifactoryServicesManager, commandType CommandType) (Builder, error)

Create instance of docker build info builder.

type CommandType

type CommandType string
const (
	Pull CommandType = "pull"
	Push CommandType = "push"
)

type Config

type Config struct {
	Digest *string `json:"digest"`
}

type Descriptor

type Descriptor struct {
	Digest *string `json:"digest"`
}

type DockerLoginConfig

type DockerLoginConfig struct {
	ArtifactoryDetails *config.ArtifactoryDetails
}

type Image

type Image interface {
	Push() error
	Id() (string, error)
	ParentId() (string, error)
	Manifest() (string, error)
	Tag() string
	Path() string
	Name() string
	Pull() error
}

Docker image

func New

func New(imageTag string) Image

type LoginCmd

type LoginCmd struct {
	DockerRegistry string
	Username       string
	Password       string
}

Login command

func (*LoginCmd) GetCmd

func (loginCmd *LoginCmd) GetCmd() *exec.Cmd

func (*LoginCmd) GetEnv

func (loginCmd *LoginCmd) GetEnv() map[string]string

func (*LoginCmd) GetErrWriter

func (loginCmd *LoginCmd) GetErrWriter() io.WriteCloser

func (*LoginCmd) GetStdWriter

func (loginCmd *LoginCmd) GetStdWriter() io.WriteCloser

type Manifest

type Manifest struct {
	Descriptor       Descriptor       `json:"descriptor"`
	SchemaV2Manifest SchemaV2Manifest `json:"SchemaV2Manifest"`
}

type SchemaV2Manifest

type SchemaV2Manifest struct {
	Config Config `json:"config"`
}

type VersionCmd

type VersionCmd struct{}

Version command

func (*VersionCmd) GetCmd

func (versionCmd *VersionCmd) GetCmd() *exec.Cmd

func (*VersionCmd) GetEnv

func (versionCmd *VersionCmd) GetEnv() map[string]string

func (*VersionCmd) GetErrWriter

func (versionCmd *VersionCmd) GetErrWriter() io.WriteCloser

func (*VersionCmd) GetStdWriter

func (versionCmd *VersionCmd) GetStdWriter() io.WriteCloser

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL