Documentation ¶
Index ¶
- Constants
- Variables
- func CreateServiceManager(artDetails *config.ArtifactoryDetails, threads int) (*artifactory.ArtifactoryServicesManager, error)
- func DockerLogin(imageTag string, config *DockerLoginConfig) error
- func IsCompatibleApiVersion(dockerOutput string) bool
- func ResolveRegistryFromTag(imageTag string) (string, error)
- func ValidateClientApiVersion() error
- type Builder
- type CommandType
- type Config
- type Descriptor
- type DockerLoginConfig
- type Image
- type LoginCmd
- type Manifest
- type SchemaV2Manifest
- type VersionCmd
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 ResolveRegistryFromTag ¶
Get docker registry from tag
func ValidateClientApiVersion ¶
func ValidateClientApiVersion() error
Types ¶
type Builder ¶
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 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
type LoginCmd ¶
Login command
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
Click to show internal directories.
Click to hide internal directories.