Documentation ¶
Overview ¶
Package docker contains utilities for interfacing with Docker (build/push).
Index ¶
- func Build(ctx context.Context, plugin *plugin.Plugin, imageName string, cachePath string, ...) ([]byte, error)
- func FindBaseImageDir(basedir string) (string, error)
- func ImageName(plugin *plugin.Plugin, org string) string
- func Push(ctx context.Context, plugin *plugin.Plugin, dockerOrg string) ([]byte, error)
- type BaseImages
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Build ¶
func Build( ctx context.Context, plugin *plugin.Plugin, imageName string, cachePath string, args []string, ) ([]byte, error)
Build runs a Docker build command for the specified plugin tagging it with the given image name. The args parameter passes any additional arguments to be passed to the build. Returns the combined stdout/stderr of the build along with any error.
func FindBaseImageDir ¶
FindBaseImageDir looks for the .github/docker folder starting from basedir. It continues to search through parent directories till found (or at the root).
Types ¶
type BaseImages ¶
type BaseImages struct {
// contains filtered or unexported fields
}
BaseImages contains state about the latest versions of base images in the .github/docker directory. These are automatically kept up to date by dependabot.
func LoadLatestBaseImages ¶
func LoadLatestBaseImages(baseImageDir string) (_ *BaseImages, retErr error)
LoadLatestBaseImages returns the latest base image information from images found in the .github/docker directory.
func (*BaseImages) ImageNameAndVersion ¶
func (b *BaseImages) ImageNameAndVersion(imageName string) string
ImageNameAndVersion returns the latest image name and version (if tracked in the .github/docker directory). For example, passing "debian" will return "debian:bookworm-yyyyMMdd" (where "yyyyMMdd" is the latest image date). If the image is not tracked in the .github/docker directory, returns an empty string. This is used to automate updating Dockerfile base image versions when fetching new versions of plugins.
func (*BaseImages) ImageVersion ¶
func (b *BaseImages) ImageVersion(imageName string) string
ImageVersion returns the latest version for the image name (if tracked in the .github/docker directory). For example, passing "debian" will return "bookworm-yyyyMMdd" (where "yyyyMMdd" is the latest image date). If the image is not tracked in the .github/docker directory, returns an empty string.