LoadConfigFiles() was only called inside the container-inspect block,
so filesToLoadIntoContainer was never populated when no builder
container existed yet. The subsequent copyFilesToContainer() call
received a nil map, sending an empty tar archive and leaving
/etc/buildkit/ empty inside the newly created container.
Move the LoadConfigFiles() call before the inspect check so the config
and certificate data is always available when creating a fresh builder.
Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Paul Gaiduk <paulg@zededa.com>
Introduce environment variables for key CI/CD flags so that self-hosted
runners (e.g. GitHub Actions) can configure registry mirrors and push
targets without modifying calling Makefiles:
- LINUXKIT_MIRROR - equivalent to --mirror (space/comma-separated);
CLI flags take precedence (last SetProxy wins)
- LINUXKIT_PKG_ORG - equivalent to --org for all pkg subcommands
- LINUXKIT_BUILDER_IMAGE - equivalent to --builder-image
- LINUXKIT_BUILDER_CONFIG - equivalent to --builder-config
All env var constants are consolidated in pkg_build.go alongside the
existing LINUXKIT_CACHE, LINUXKIT_BUILDER_NAME, LINUXKIT_BUILDERS.
Priority for all: CLI flag > env var > built-in default
Adds a new Environment Variables section to docs/packages.md with a
reference table covering all LINUXKIT_* vars and a note explaining the
two-layer mirror configuration required in CI (linuxkit pulls vs
buildkit Dockerfile pulls).
Signed-off-by: Roman Shaposhnik <rucoder@gmail.com>
Signed-off-by: Mikhail Malyshev <mike.malyshev@gmail.com>
The moby/buildkit image declares VOLUME /var/lib/buildkit, which causes
Docker to create an anonymous volume when no explicit mount is given.
These anonymous volumes are orphaned every time the builder container is
recreated (--builder-restart, config change, privilege fix), leaking
disk space.
Switch to a named volume (<builder-name>-state) that is explicitly
mounted on container creation. This:
- Preserves build cache across container restarts, config changes, and
privilege fixes, making rebuilds faster.
- Eliminates anonymous volume leaks.
- Removes the state volume when the builder image version changes, since
buildkit state compatibility across versions is not guaranteed.
Signed-off-by: Mikhail Malyshev <mike.malyshev@gmail.com>
On shared servers where multiple users build packages against the same
Docker daemon, all users fight over a single hardcoded builder container
named "linuxkit-builder". One user's build can destroy another's
in-flight build when builder lifecycle management detects mismatches.
Make the builder container name configurable:
1. --builder-name CLI flag (highest priority)
2. LINUXKIT_BUILDER_NAME environment variable
3. "linuxkit-builder" default (original behavior, unchanged)
The flag is available on both "linuxkit pkg build" and
"linuxkit pkg builder" (du/prune) commands. Users on shared servers
can set LINUXKIT_BUILDER_NAME or pass --builder-name to get per-user
isolation (e.g. LINUXKIT_BUILDER_NAME=linuxkit-builder-$USER).
Signed-off-by: Mikhail Malyshev <mike.malyshev@gmail.com>
Group the four builder-related fields (name, image, config path, restart)
that always travel together into a BuilderConfig struct. This simplifies:
- DockerRunner interface (Build() and Builder() lose 3 params each)
- buildOpts struct (4 fields -> 1)
- buildArch() function signature (3 fewer params)
- DiskUsage() / PruneBuilder() / getClientForPlatform() signatures
- 4 WithBuildBuilder*() option functions -> 1 WithBuildBuilderConfig()
Also rename the confusingly-named "builderName" local variables in
buildArch() and getClientForPlatform() to "dockerContext", which better
reflects their actual purpose (they hold a Docker context name, not the
builder container name).
No behavioral changes.
Signed-off-by: Mikhail Malyshev <mike.malyshev@gmail.com>
* separate kernel series hashing
Signed-off-by: Chris Irrgang <chris.irrgang@gmx.de>
* fix issues with the update component sha script
- add bsd/gnu cross compatibility for sed
- also replace in */test.sh files
- replace potentially problematic xargs
- remove potentially problematic word boundary \b
Signed-off-by: Chris Irrgang <chris.irrgang@gmx.de>
* Move common kernel files to dedicated folder
Signed-off-by: Chris Irrgang <chris.irrgang@gmx.de>
* run update-kernel-yamls
Signed-off-by: Chris Irrgang <chris.irrgang@gmx.de>
---------
Signed-off-by: Chris Irrgang <chris.irrgang@gmx.de>