Documentation ¶
Index ¶
- Constants
- Variables
- func ContainerManagerLogin(imageTag string, config *ContainerManagerLoginConfig, ...) error
- func GetImageTagWithDigest(filePath string) (tag string, sha256 string, err error)
- func IsCompatibleApiVersion(dockerOutput string) bool
- func ResolveRegistryFromTag(imageTag string) (string, error)
- func ValidateClientApiVersion() error
- type Builder
- type CommandType
- type ContainerManager
- type ContainerManagerLoginConfig
- type ContainerManagerType
- type FatManifest
- type Image
- type LoginCmd
- type ManifestDetails
- type Platform
- type RepositoryDetails
- type VersionCmd
Constants ¶
const LoginFailureMessage string = "%s login failed for: %s.\n %s image must be in the form: registry-domain/path-in-repository/image-name:version."
Docker login error message
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 ¶
var ApiVersionRegex = regexp.MustCompile(`^(\d+)\.(\d+)$`)
Search for docker API version format pattern e.g. 1.40
Functions ¶
func ContainerManagerLogin ¶
func ContainerManagerLogin(imageTag string, config *ContainerManagerLoginConfig, containerManager ContainerManagerType) error
First we'll 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 GetImageTagWithDigest ¶
Read the file which contains the following format: 'IMAGE-TAG-IN-ARTIFACTORY'@sha256'SHA256-OF-THE-IMAGE-MANIFEST'.
func IsCompatibleApiVersion ¶
func ResolveRegistryFromTag ¶
Get 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, project string, serviceManager artifactory.ArtifactoryServicesManager, commandType CommandType, containerManager ContainerManager) (Builder, error)
func NewKanikoBuildInfoBuilder ¶
func NewKanikoBuildInfoBuilder(image *Image, repository, buildName, buildNumber, project string, serviceManager artifactory.ArtifactoryServicesManager, commandType CommandType, containerManager ContainerManager, manifestSha256 string) (Builder, error)
type CommandType ¶
type CommandType string
const ( Pull CommandType = "pull" Push CommandType = "push" )
type ContainerManager ¶
type ContainerManager interface { Push(image *Image) error Id(image *Image) (string, error) OsCompatibility(image *Image) (string, string, error) Pull(image *Image) error GetContainerManagerType() ContainerManagerType }
Container image
func NewManager ¶
func NewManager(containerManagerType ContainerManagerType) ContainerManager
type ContainerManagerLoginConfig ¶
type ContainerManagerLoginConfig struct {
ServerDetails *config.ServerDetails
}
type ContainerManagerType ¶
type ContainerManagerType int
const ( DockerClient ContainerManagerType = iota Podman Kaniko )
func (ContainerManagerType) String ¶
func (cmt ContainerManagerType) String() string
type FatManifest ¶
type FatManifest struct {
Manifests []ManifestDetails `json:"manifests"`
}
type Image ¶
type Image struct {
// contains filtered or unexported fields
}
type LoginCmd ¶
type LoginCmd struct { DockerRegistry string Username string Password string // contains filtered or unexported fields }
Login command
func (*LoginCmd) GetErrWriter ¶
func (loginCmd *LoginCmd) GetErrWriter() io.WriteCloser
func (*LoginCmd) GetStdWriter ¶
func (loginCmd *LoginCmd) GetStdWriter() io.WriteCloser
type ManifestDetails ¶
type RepositoryDetails ¶
type RepositoryDetails struct {
// contains filtered or unexported fields
}
type VersionCmd ¶
type VersionCmd struct{}
Version command Docker-client provides an API for interacting with the Docker daemon. This cmd should be used for docker client only.
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