docker

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2021 License: MPL-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConstructBuildCommand

func ConstructBuildCommand(opts types.ImageBuildOptions, buildpath string) string

ConstructBuildCommand constructs the building command.

func ConstructImageInspectCommand

func ConstructImageInspectCommand(tag string) string

ConstructImageInspectCommand constructs the inspecting image command.

func ConstructImagePushCommand

func ConstructImagePushCommand(tag string) string

ConstructImagePushCommand constructs the pushing image command.

func ConstructManifestCreateCommand

func ConstructManifestCreateCommand(tag string, manifests ...string) string

ConstructManifestCreateCommand constructs the creating manifest command.

func ConstructManifestPushCommand

func ConstructManifestPushCommand(tag string) string

ConstructManifestPushCommand constructs the pushing manifest command.

func ConstructRegistryLoginCommand

func ConstructRegistryLoginCommand(registry, username, password string) string

ConstructRegistryLoginCommand constructs the login registry command.

func GetBuildpathArchive

func GetBuildpathArchive(path string, dockerfile string) (io.ReadCloser, error)

GetBuildpathArchive retrieves the context to build.

func GetImageDigest

func GetImageDigest(ctx context.Context, image string, opts ...GetImageDigestOption) (string, error)

GetImageDigest returns the image digest.

func InjectTargetPlatformArgsToDockerfile added in v0.2.3

func InjectTargetPlatformArgsToDockerfile(raw io.Reader, os, arch, variant string) io.Reader

func ZipWithOptions

func ZipWithOptions(srcPath string, options *ZipOptions) (io.ReadCloser, error)

ZipWithOptions creates an archive from the directory at `path`, only including files whose relative paths are included in `options.IncludeFiles` (if non-nil) or not in `options.ExcludePatterns`.

Types

type GetImageDigestOption

type GetImageDigestOption func(rt http.RoundTripper) http.RoundTripper

func WithBasicAuth

func WithBasicAuth(username, password string) GetImageDigestOption

func WithBearerToken

func WithBearerToken(token string) GetImageDigestOption

func WithManifestSupport

func WithManifestSupport() GetImageDigestOption

func WithManifestV1SupportOnly

func WithManifestV1SupportOnly() GetImageDigestOption

type StructuredName

type StructuredName struct {
	Registry   string
	Repository string
	Tag        string
}

StructuredName structures the image name.

func ParseImage

func ParseImage(image string) StructuredName

ParseImage parses the image string to a structure, it can parse the following image string: - docker.io/library/ubuntu:21.04 -> {docker.io, library/ubuntu, 21.04} - docker.io/library/ubuntu -> {docker.io, library/ubuntu, latest} - library/ubuntu:20.10 -> {docker.io, library/ubuntu, 20.10} - ubuntu:latest -> {docker.io, library/ubuntu, latest} - ubuntu -> {docker.io, library/ubuntu, latest}

func (StructuredName) GetManifestRequest

func (i StructuredName) GetManifestRequest(ctx context.Context) (*http.Request, error)

func (StructuredName) String

func (i StructuredName) String() string

type ZipOptions

type ZipOptions struct {
	IncludeFiles     []string
	ExcludePatterns  []string
	IncludeSourceDir bool
}

Jump to

Keyboard shortcuts

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