Documentation
¶
Overview ¶
Package build renders Dockerfiles for layered presets, computes deterministic image tags, and invokes `docker build` to materialize them.
Index ¶
- Constants
- func Dockerfile(p config.Preset) string
- func EnsureImage(name string, p config.Preset) (string, error)
- func ImageExists(tag string) bool
- func LatestRef(ref string) string
- func NeedsBuild(p config.Preset) bool
- func ResolveLatestDigest(ref string) (string, error)
- func Tag(name string, p config.Preset) string
Constants ¶
const ImageNamePrefix = "drun"
ImageNamePrefix is the local image namespace used for built layer images.
Variables ¶
This section is empty.
Functions ¶
func Dockerfile ¶
Dockerfile renders the Dockerfile contents for a preset.
func EnsureImage ¶
EnsureImage builds the layer image if not present and returns the tag to run.
func ImageExists ¶
ImageExists returns true if the local docker daemon has the given tag.
func LatestRef ¶ added in v0.2.0
LatestRef rewrites an image reference so it points at the `:latest` tag of the same repository, stripping any existing tag and/or digest. Registry host and port are preserved. The returned ref always ends in ":latest".
alpine -> alpine:latest golang:1.24-alpine -> golang:latest ghcr.io/foo/bar:canary -> ghcr.io/foo/bar:latest registry.local:5000/foo/bar:v1 -> registry.local:5000/foo/bar:latest foo@sha256:abcd -> foo:latest ghcr.io/foo/bar:v1@sha256:abcd -> ghcr.io/foo/bar:latest
func NeedsBuild ¶
NeedsBuild reports whether the preset declares any layer.
func ResolveLatestDigest ¶ added in v0.2.0
ResolveLatestDigest pulls the given ref (expected to be `<repo>:latest`) and returns a digest-pinned reference of the form `<repo>@sha256:...`. This lets callers feed the ref into `Tag`/`hash` so that as upstream `:latest` moves, the resulting layer image tag changes too — without forcing a rebuild when nothing upstream actually changed between runs.
Types ¶
This section is empty.