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 NewLocalAgentBuildInfoBuilder(image *Image, repository, buildName, buildNumber, project string, ...) (*localAgentbuildInfoBuilder, error)
- func NewRemoteAgentBuildInfoBuilder(image *Image, repository, buildName, buildNumber, project string, ...) (*remoteAgentbuildInfoBuilder, error)
- 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 NewLocalAgentBuildInfoBuilder ¶ added in v2.8.0
func NewLocalAgentBuildInfoBuilder(image *Image, repository, buildName, buildNumber, project string, serviceManager artifactory.ArtifactoryServicesManager, commandType CommandType, containerManager ContainerManager) (*localAgentbuildInfoBuilder, error)
Create new build info builder container CLI tool
func NewRemoteAgentBuildInfoBuilder ¶ added in v2.8.0
func NewRemoteAgentBuildInfoBuilder(image *Image, repository, buildName, buildNumber, project string, serviceManager artifactory.ArtifactoryServicesManager, manifestSha256 string) (*remoteAgentbuildInfoBuilder, error)
func ResolveRegistryFromTag ¶
Get registry from tag
func ValidateClientApiVersion ¶
func ValidateClientApiVersion() error
Types ¶
type Builder ¶
type Builder interface { Build(module string) (*buildinfo.BuildInfo, error) UpdateArtifactsAndDependencies() error GetLayers() *[]utils.ResultItem }
Docker image build info builder.
type CommandType ¶
type CommandType string
const ( Pull CommandType = "pull" Push CommandType = "push" )
type ContainerManager ¶
type ContainerManager interface { Push(image *Image) error // Image ID is basically the image's SHA256 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 )
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
}
func (*Image) GetImageBaseName ¶ added in v2.8.0
Get image base name by removing the prefixed registry hostname and the tag. e.g.: https://my-registry/docker-local/hello-world:latest. -> hello-world
func (*Image) GetImageBaseNameWithTag ¶ added in v2.8.0
Get image name from tag by removing the prefixed registry hostname.
type LoginCmd ¶
type LoginCmd struct { DockerRegistry string Username string Password string // contains filtered or unexported fields }
Login command
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) RunCmd ¶ added in v2.1.0
func (versionCmd *VersionCmd) RunCmd() (string, error)