image

package
v0.46.1 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2026 License: MIT, MIT Imports: 10 Imported by: 0 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 is `pstack build-image` — build the control image from the running binary itself.

WHY THIS EXISTS. `pstack init` requires the control image to exist locally and deliberately does not pull. A CLI that cannot produce the one artefact it requires is a broken install, so the image is built HERE, from what is already on the host: pstack is one static binary, and the control image is that binary on a slim base with the docker CLI beside it. No checkout, no registry, and no second download — the image carries exactly the version that built it.

The Dockerfile INSTALLS this exact version inside the build, with the same `install.sh` an operator runs — an EMPTY context, so the build needs nothing on the host but docker, and it works from macOS because the build itself runs Linux. `PSTACK_BINARY=<path>` copies a local binary in instead, for a version that is not published yet or a host with no network.

The advanced UI image is unchanged in principle: the SPA package is a BUILD-TIME input fetched from npm inside the build, so docker — not the host — needs a JavaScript runtime. `--ui-dist` keeps the old behaviour of building from local files, for developing a change that is not published yet.

Index

Constants

View Source
const DefaultHearthUIImageTag = "pstack-ui-hearth:local"

DefaultHearthUIImageTag matches PSTACK_UI_HEARTH_IMAGE's default in `init`.

View Source
const DefaultImageTag = "pstack:local"

DefaultImageTag is the control image's tag.

View Source
const DefaultUIImageTag = "pstack-ui:local"

DefaultUIImageTag matches PSTACK_UI_IMAGE's default in `init`, so `build-image --ui` then `init --ui advanced` need no flags between them.

Variables

This section is empty.

Functions

func Build

func Build(opts BuildOptions) error

Build assembles a build context from the installed bundle and builds the image.

The context is a temp directory rather than the install directory: an install may live somewhere read-only (or shared between projects), and writing a Dockerfile into a package's own directory would mutate an installed dependency. It is removed even on failure — a half-built context left in /tmp is the sort of litter nobody goes looking for.

func ControlDockerfile

func ControlDockerfile(ver string) string

ControlDockerfile is the control image: the pstack binary on debian:bookworm-slim with bash (hooks are bash), ca-certificates and curl (the installer, ACME, webhooks), and the docker CLI + compose plugin lifted from the official image.

Pinned to the running CLI's version so the image and the CLI that rendered it cannot disagree. The context is empty: the Dockerfile installs this version with the release's install.sh. localControlDockerfile is the variant that COPYs a binary from the context instead.

func DefaultUITag added in v0.43.0

func DefaultUITag(app string) string

DefaultUITag is the tag for a UI app's image: "hearth" or (anything else) "advanced".

func UIDockerfile

func UIDockerfile(app, ver string) string

UIDockerfile is a UI image (advanced or hearth): nginx over the published SPA package. Also builds with an empty context.

Types

type BuildOptions

type BuildOptions struct {
	Tag    string
	Runner exec.Runner
	DryRun bool
	// UIApp builds a UI image instead of the control-plane image: "advanced" or "hearth" ("" = control).
	UIApp string
	// UIDist is an explicit path to a built UI `dist/`, for when the package is installed somewhere unusual.
	UIDist string
	// Binary is a Linux binary to COPY into the image instead of installing the release
	// (PSTACK_BINARY). Default: none — the Dockerfile installs this version itself. A test passes
	// any file.
	Binary string
	// Out is where progress lines go (stdout when nil).
	Out io.Writer
}

BuildOptions are build-image's inputs.

Jump to

Keyboard shortcuts

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