dockerbuild

package
v1.0.0-rc.12 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package dockerbuild is how AppTown builds an image on a Docker daemon: with that daemon's own builder named explicitly, the extra certificates as the build's secret and the label that says AppTown made the image. Every build on a daemon goes through it (deployments, previews, check images, the agent image, on AppTown's machine and on a worker), so the source and its build go to the daemon chosen and nowhere else.

Naming the builder is the one rule: plain `docker build` otherwise honours an ambient selection, a builder alias (`docker buildx install`) with a saved remote builder, or BUILDX_BUILDER. The builder is the daemon's own: "default" for a daemon chosen by --host, otherwise the one named after the Docker context in use. It must use the docker driver (the daemon's own BuildKit), or the build is refused before anything is sent. Buildx is required beside the docker CLI: without it the build is refused, saying so, rather than falling back to the daemon's legacy builder.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Daemon

type Daemon struct {
	Run Run
	// HostChosen says the daemon was chosen with --host (another
	// machine's): its builder is "default", not the context's.
	HostChosen bool
	// Local says the daemon is on this machine, so the extra certificates
	// are this machine's (trust.BuildArgs).
	Local bool
}

Daemon is the daemon a build goes to, as the builder rule needs it.

func (Daemon) Args

func (d Daemon) Args(ctx context.Context, args ...string) ([]string, error)

Args is the whole `docker build` command line for args (the build's own arguments, its context last), the builder chosen by the rule above.

func (Daemon) Build

func (d Daemon) Build(ctx context.Context, args ...string) ([]byte, error)

Build runs the build Args makes.

type Run

type Run func(ctx context.Context, args ...string) ([]byte, error)

Run runs one docker command (the arguments after the binary) on the daemon the build is for, and answers with its output.

Jump to

Keyboard shortcuts

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