image

package
v0.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 6, 2026 License: Apache-2.0 Imports: 8 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

View Source
const DefaultPlatform = "linux/amd64"

DefaultPlatform is what managed container services run.

Variables

This section is empty.

Functions

func BuildAndPush

func BuildAndPush(ctx context.Context, env *adapter.Env, b Build) (string, error)

BuildAndPush runs `docker buildx build --push` and returns the pushed image as repository@sha256:digest.

func MovingTag added in v0.3.1

func MovingTag(ref string) (tag string, moving bool)

MovingTag reports whether an image reference names a tag that is expected to move, and which tag that is. A reference with a digest never moves. Without one, no tag at all means "latest", and a tag with no digit in it ("latest", "main", "stable") reads as a channel or a branch rather than a version.

A deploy from a moving tag runs whatever the tag points at when the platform pulls it, which behind a caching registry can be an image from days ago.

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
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL