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) ContainerEngine() tools.ContainerEngine
- func (d *Cli) Inspect(ctx context.Context, imageName string, format string) (string, error)
- func (d *Cli) InstallUrl() string
- func (d *Cli) IsContainerdEnabled(ctx context.Context) (bool, error)
- 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) Remove(ctx context.Context, imageName string) error
- func (d *Cli) Tag(ctx context.Context, cwd string, imageName string, tag string) error
- type ContainerEngineUnavailableError
- type ContainerImage
Constants ¶
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, buildNetwork 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) ContainerEngine ¶ added in v1.25.5
func (d *Cli) ContainerEngine() tools.ContainerEngine
ContainerEngine returns the container engine name ("docker" or "podman"), selected once per Cli from AZD_CONTAINER_RUNTIME and PATH without checking version or daemon readiness. It defaults to "docker" if selection fails; CheckInstalled reports the selection error. This also supports callers such as dotnet publish that do not require a local runtime.
func (*Cli) InstallUrl ¶
func (*Cli) IsContainerdEnabled ¶
IsContainerdEnabled checks if Docker is using containerd as the image store
type ContainerEngineUnavailableError ¶ added in v1.34.1
type ContainerEngineUnavailableError struct {
}
ContainerEngineUnavailableError indicates that the installed engine failed its readiness check. The cause may be a stopped runtime, connection failure, or insufficient permissions.
func (*ContainerEngineUnavailableError) Error ¶ added in v1.34.1
func (e *ContainerEngineUnavailableError) Error() string
Error returns the container engine readiness failure.
func (*ContainerEngineUnavailableError) Unwrap ¶ added in v1.34.1
func (e *ContainerEngineUnavailableError) Unwrap() error
Unwrap returns the underlying readiness check error.
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