container

package
v2.53.0 Latest Latest
Warning

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

Go to latest
Published: May 22, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
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

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 ContainerManagerLogin

func ContainerManagerLogin(image *Image, config *ContainerManagerLoginConfig, containerManager ContainerManagerType) error

First we'll try to log in 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 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 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 {
	// Image ID is basically the image's SHA256
	Id(image *Image) (string, error)
	OsCompatibility(image *Image) (string, string, error)
	RunNativeCmd(cmdParams []string) 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 GetImageTagWithDigest

func GetImageTagWithDigest(filePath string) (*Image, string, error)

Read the file which contains the following format: 'IMAGE-TAG-IN-ARTIFACTORY'@sha256'SHA256-OF-THE-IMAGE-MANIFEST'.

func NewImage

func NewImage(imageTag string) *Image

func (*Image) GetImageLongName added in v2.10.0

func (image *Image) GetImageLongName() (string, error)

Get image base name by removing the prefixed registry hostname and the tag. e.g.: https://my-registry/docker-local/hello-world:latest. -> docker-local/hello-world

func (*Image) GetImageLongNameWithTag added in v2.10.0

func (image *Image) GetImageLongNameWithTag() (string, error)

Get image name from tag by removing the prefixed registry hostname. e.g.: https://my-registry/docker-local/hello-world:latest. -> docker-local/hello-world:latest

func (*Image) GetImageShortName added in v2.10.0

func (image *Image) GetImageShortName() (string, error)

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) GetImageShortNameWithTag added in v2.10.0

func (image *Image) GetImageShortNameWithTag() (string, error)

Get image base name by removing the prefixed registry hostname. e.g.: https://my-registry/docker-local/hello-world:latest. -> hello-world:latest

func (*Image) GetImageTag added in v2.10.0

func (image *Image) GetImageTag() (string, error)

Get image tag name of an image. e.g.: https://my-registry/docker-local/hello-world:latest. -> latest

func (*Image) GetRegistry added in v2.10.0

func (image *Image) GetRegistry() (string, error)

func (*Image) GetRemoteRepo added in v2.10.0

func (image *Image) GetRemoteRepo(serviceManager artifactory.ArtifactoryServicesManager) (string, error)

Returns the physical Artifactory repository name of the pulled/pushed image, by reading a response header from Artifactory.

func (*Image) Name

func (image *Image) Name() string

Get image name

type LoginCmd

type LoginCmd struct {
	DockerRegistry string
	Username       string
	Password       string
	// contains filtered or unexported fields
}

Login command

func (*LoginCmd) GetCmd

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

func (*LoginCmd) RunCmd added in v2.1.0

func (loginCmd *LoginCmd) RunCmd() error

type ManifestDetails

type ManifestDetails struct {
	Digest   string   `json:"digest"`
	Platform Platform `json:"platform"`
}

type Platform

type Platform struct {
	Architecture string `json:"architecture"`
	Os           string `json:"os"`
}

type RemoteAgentBuildInfoBuilder added in v2.33.0

type RemoteAgentBuildInfoBuilder struct {
	// contains filtered or unexported fields
}

Build-info builder for remote agents tools such as: Kaniko, OpenShift CLI (oc), or buildx.

func NewRemoteAgentBuildInfoBuilder added in v2.8.0

func NewRemoteAgentBuildInfoBuilder(image *Image, repository, buildName, buildNumber, project string, serviceManager artifactory.ArtifactoryServicesManager, manifestSha256 string) (*RemoteAgentBuildInfoBuilder, error)

func (*RemoteAgentBuildInfoBuilder) Build added in v2.33.0

func (rabib *RemoteAgentBuildInfoBuilder) Build(module string) (*buildinfo.BuildInfo, error)

func (*RemoteAgentBuildInfoBuilder) GetLayers added in v2.33.0

func (rabib *RemoteAgentBuildInfoBuilder) GetLayers() *[]utils.ResultItem

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)

Jump to

Keyboard shortcuts

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