Documentation ¶
Index ¶
- Constants
- func SplitDockerImage(fullImg string) (name string, tag string)
- type Cli
- func (d *Cli) Build(ctx context.Context, cwd string, dockerFilePath string, platform string, ...) (string, error)
- func (d *Cli) CheckInstalled(ctx context.Context) error
- func (d *Cli) Inspect(ctx context.Context, imageName string, format string) (string, error)
- func (d *Cli) InstallUrl() string
- func (d *Cli) Login(ctx context.Context, loginServer string, username string, password string) error
- func (d *Cli) Name() string
- func (d *Cli) Pull(ctx context.Context, imageName string) error
- func (d *Cli) Push(ctx context.Context, cwd string, tag string) error
- func (d *Cli) Tag(ctx context.Context, cwd string, imageName string, tag string) error
- type ContainerImage
Constants ¶
View Source
const DefaultPlatform string = "linux/amd64"
Variables ¶
This section is empty.
Functions ¶
func SplitDockerImage ¶
SplitDockerImage splits the image into the name and tag. If the image does not have a tag or is invalid, the full string is returned as name, and tag will be empty.
Types ¶
type Cli ¶
type Cli struct {
// contains filtered or unexported fields
}
func NewCli ¶
func NewCli(commandRunner exec.CommandRunner) *Cli
func (*Cli) Build ¶
func (d *Cli) Build( ctx context.Context, cwd string, dockerFilePath string, platform string, target string, buildContext string, tagName string, buildArgs []string, buildSecrets []string, buildEnv []string, buildProgress io.Writer, ) (string, error)
Runs a Docker build for a given Dockerfile, writing the output of docker build to [stdOut] when it is not nil. If the platform is not specified (empty) it defaults to amd64. If the build is successful, the function returns the image id of the built image.
func (*Cli) InstallUrl ¶
type ContainerImage ¶
type ContainerImage struct { // The registry name Registry string `json:"registry,omitempty"` // The repository name or path Repository string `json:"repository,omitempty"` // The tag Tag string `json:"tag,omitempty"` }
ContainerImage represents a container image and its components
func ParseContainerImage ¶
func ParseContainerImage(image string) (*ContainerImage, error)
func (*ContainerImage) Local ¶
func (ci *ContainerImage) Local() string
Local returns the local image name without registry
func (*ContainerImage) Remote ¶
func (ci *ContainerImage) Remote() string
Remote returns the remote image name with registry when specified
Click to show internal directories.
Click to hide internal directories.