Documentation
¶
Overview ¶
Package image builds container images and pushes them to a registry. It returns the pushed digest, so a deploy runs exactly the image it built.
Index ¶
Constants ¶
const DefaultPlatform = "linux/amd64"
DefaultPlatform is what managed container services run.
Variables ¶
This section is empty.
Functions ¶
func BuildAndPush ¶
BuildAndPush runs `docker buildx build --push` and returns the pushed image as repository@sha256:digest.
func WriteGenerated ¶
func WriteGenerated(dir, name string, g *dockerfile.Result) (string, error)
WriteGenerated writes a generated Dockerfile and its ignore file into dir as <name>.Dockerfile, and returns the Dockerfile's path. BuildKit reads the ignore file from next to the Dockerfile.
Types ¶
type Build ¶
type Build struct {
// Context is the build context directory.
Context string
// Dockerfile is the path of the Dockerfile to build.
Dockerfile string
// Repository is the image name without a tag, e.g. us-docker.pkg.dev/p/r/app-web.
Repository string
// Tag is the tag pushed alongside the digest; "latest" when empty.
Tag string
Platform string
}