Documentation ¶
Index ¶
- Constants
- Variables
- func ContainerManagerLogin(image *Image, config *ContainerManagerLoginConfig, ...) error
- func NewLocalAgentBuildInfoBuilder(image *Image, repository, buildName, buildNumber, project string, ...) (*localAgentbuildInfoBuilder, error)
- func ValidateClientApiVersion() error
- type Annotations
- type Builder
- type CommandType
- type ContainerManager
- type ContainerManagerLoginConfig
- type ContainerManagerType
- type FatManifest
- type Image
- func (image *Image) GetImageLongName() (string, error)
- func (image *Image) GetImageLongNameWithTag() (string, error)
- func (image *Image) GetImageShortName() (string, error)
- func (image *Image) GetImageShortNameWithTag() (string, error)
- func (image *Image) GetImageTag() (string, error)
- func (image *Image) GetRegistry() (string, error)
- func (image *Image) GetRemoteRepo(serviceManager artifactory.ArtifactoryServicesManager) (string, error)
- func (image *Image) Name() string
- type LoginCmd
- type ManifestDetails
- type Platform
- type RemoteAgentBuildInfoBuilder
- type RepositoryDetails
- type VersionCmd
Constants ¶
const ( Pull CommandType = "pull" Push CommandType = "push" ManifestJsonFile = "manifest.json" AttestationsModuleIdPrefix string = "attestations" )
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(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 Annotations ¶ added in v2.54.2
type Annotations struct { ReferenceDigest string `json:"vnd.docker.reference.digest"` ReferenceType string `json:"vnd.docker.reference.type"` }
Annotations for attestation manifests.
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
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 ¶
Read the file which contains the following format: 'IMAGE-TAG-IN-ARTIFACTORY'@sha256'SHA256-OF-THE-IMAGE-MANIFEST'.
func (*Image) GetImageLongName ¶ added in v2.10.0
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
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
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
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
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) 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.
type LoginCmd ¶
type LoginCmd struct { DockerRegistry string Username string Password string // contains filtered or unexported fields }
Login command
type ManifestDetails ¶
type ManifestDetails struct { Digest string `json:"digest"` Platform Platform `json:"platform"` Annotations Annotations `json:"annotations"` }
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)