Documentation ¶
Index ¶
- Variables
- func Build(moduleDir, tag string) error
- func BuildCmd(moduleDir, tag string) magelib.Cmd
- func BuildWithArgs(moduleDir, tag string, args magelib.ArgsMap) error
- func BuildWithArgsCmd(moduleDir, tag string, args magelib.ArgsMap) magelib.Cmd
- func BuildWithFile(moduleDir, dockerfilePath, tag string) error
- func BuildWithFileCmd(moduleDir, dockerfilePath, tag string) magelib.Cmd
- func ContainerNameByLabel(label string) (string, error)
- func ImageDigestLocal(tag string) (string, error)
- func ImageDigestRemote(tag string) (string, error)
- func IsImageAvailable(imageName string) bool
- func Push(tag string) error
- func PushCmd(tag string) magelib.Cmd
- func PushOnDemand(tag string) error
- func PushOnDemandCmd(tag string) magelib.Cmd
- func RemoveLocalImage(imageName string) error
- func RemoveLocalImageCmd(imageName string) magelib.Cmd
- func RemoveUntaggedImages() error
- func RemoveUntaggedImagesCmd() magelib.Cmd
Constants ¶
This section is empty.
Variables ¶
var ( Out = sh.OutCmd("docker") CraneDigestOut = sh.OutCmd("crane", "digest") )
Functions ¶
func Build ¶
Build builds a Docker image.
Parameters: moduleDir (string) - the directory of the module, tag (string) - the tag of the image. Returns: error - an error if the operation fails.
func BuildWithArgs ¶
BuildWithArgs builds a Docker image with the specified build arguments and tags it with the given tag.
Parameters: moduleDir (string) - the directory of the module, tag (string) - the tag of the image, args (magelib.ArgsMap) - the build arguments. Returns: error - an error if the operation fails.
func BuildWithArgsCmd ¶
BuildWithArgs as magelib.Cmd
func BuildWithFile ¶
BuildWithFile builds a Docker image using the specified Dockerfile and tags it with the given tag.
Parameters: - moduleDir: the directory of the module. - dockerfilePath: the path to the Dockerfile. - tag: the tag to give to the Docker image.
Returns: - error: an error if the operation fails.
func BuildWithFileCmd ¶
BuildWithFile as magelib.Cmd
func ContainerNameByLabel ¶
ContainerNameByLabel gets the name of a Docker container by its label.
Parameters: label (string) - the label of the Docker container. Returns: name (string) - the name of the Docker container, err (error) - an error if the operation fails.
func ImageDigestLocal ¶
ImageDigestLocal retrieves the digest of a Docker image with the given tag on the local machine.
Parameters: - tag: the tag of the Docker image.
Returns: - string: the digest of the Docker image. - error: an error if the operation fails.
func ImageDigestRemote ¶
ImageDigestRemote retrieves the digest of a Docker image with the given tag remotely.
Parameters: - tag (string): the tag of the Docker image.
Returns: - string: the digest of the Docker image. - error: an error if the operation fails.
func IsImageAvailable ¶
IsImageAvailable checks if a Docker image is available on the local machine.
Parameters: - imageName (string): the name of the Docker image to check.
Returns: - bool: true if the image is available, false otherwise.
func Push ¶
Push pushes a Docker image with the given tag.
Parameters: - tag: the tag of the Docker image to push.
Returns: - error: an error if the push operation fails.
func PushCmd ¶
PushCmd returns a magelib.Cmd that pushes a Docker image with the given tag.
Parameters: - tag (string): the tag of the Docker image to push.
Returns: - magelib.Cmd: a function that returns an error if the push operation fails.
func PushOnDemand ¶
PushOnDemand pushes a Docker image with the given tag only if the local and remote digests do not match.
Parameters: - tag (string): the tag of the Docker image.
Returns: - error: an error if the push operation fails.
func PushOnDemandCmd ¶
PushOnDemandCmd returns a magelib.Cmd that pushes a Docker image with the given tag only if the local and remote digests do not match.
Parameters: - tag (string): the tag of the Docker image.
Returns: - magelib.Cmd: a function that returns an error if the push operation fails.
func RemoveLocalImage ¶
RemoveLocalImage removes a local Docker image.
Parameters: - imageName (string): the name of the Docker image to remove.
Returns: - error: an error if the removal operation fails.
func RemoveLocalImageCmd ¶
RemoveLocalImage as magelib.Cmd
func RemoveUntaggedImages ¶
func RemoveUntaggedImages() error
RemoveUntaggedImages removes untagged Docker images.
No parameters. Returns an error if the operation fails.
func RemoveUntaggedImagesCmd ¶
RemoveUntaggedImages as magelib.Cmd
Types ¶
This section is empty.