gon build

Build a production Docker image. Multi-stage build: composer deps, frontend assets, production PHP-FPM image.

Usage

gon build # Auto-increment tag (v2.2.0 → v2.2.1)
gon build --push # Build + push to GHCR
gon build --tag=v1.0.0 --push # Explicit tag and push
gon build --no-cache --push # Clean rebuild

Auto-increment tag

Without --tag, queries GHCR for the latest semver tag and increments the patch version automatically. If no versions exist, starts at v1.0.0.

Cross-platform

On Apple Silicon, automatically cross-compiles for linux/amd64 using buildx + QEMU.

gon build --platform=linux/arm64 --push # ARM servers
gon build --platform= # Native platform

Image

ghcr.io/rozklad/gon-{project}:{tag}

See also

gon release — build + push + deploy in one step.