GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — pkg build: add env var support for mirror, org, builder image and config by rucoder · Pull Request #4205 · linuxkit/linuxkit

Conversation

@rucoder

@rucoder rucoder commented Mar 12, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds environment variable equivalents for four flags that are commonly needed when running linuxkit on CI/CD self-hosted runners with private registry mirrors, so callers (e.g. make in downstream projects) don't need to be modified to pass these flags explicitly.

Env var Equivalent flag Scope
LINUXKIT_MIRROR --mirror All commands
LINUXKIT_PKG_ORG --org pkg subcommands
LINUXKIT_BUILDER_IMAGE --builder-image pkg build
LINUXKIT_BUILDER_CONFIG --builder-config pkg build

Priority: CLI flag > env var > built-in default (consistent with existing LINUXKIT_CACHE, LINUXKIT_BUILDER_NAME, LINUXKIT_BUILDERS).

LINUXKIT_MIRROR accepts the same format as --mirror ([registry=]url), as a space- or comma-separated list. Env var entries are prepended to CLI-provided entries so that the final SetProxy call for a given registry key comes from the CLI flag, giving it precedence.

LINUXKIT_BUILDER_IMAGE and LINUXKIT_BUILDER_CONFIG use the existing flagOverEnvVarOverDefaultString helper (same pattern as LINUXKIT_BUILDER_NAME).

Test plan

  • go build ./... passes
  • go test -mod=vendor ./... passes (all existing tests green)
  • Set LINUXKIT_MIRROR=docker.io=http://mymirror and verify linuxkit routes pulls through the mirror
  • Set LINUXKIT_PKG_ORG=myorg and verify linuxkit pkg show-tag reflects the org override
  • Set LINUXKIT_BUILDER_IMAGE and verify the builder container uses the specified image
  • Verify CLI flags override the env vars when both are set

🤖 Generated with Claude Code

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@rucoder
pkg build: add env var support for mirror, org, builder image and config
666bbfd
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 <[email protected]>
Signed-off-by: Mikhail Malyshev <[email protected]>
@rucoder
rucoder force-pushed the rucoder/env-vars-for-ci branch from 2a95152 to 666bbfd Compare March 12, 2026 10:48
@rucoder rucoder mentioned this pull request Mar 12, 2026
Makefile: use linuxkit env vars for org and builder config lf-edge/eve#5669
Closed
4 of 7 tasks
justincormack
justincormack approved these changes Mar 12, 2026
View reviewed changes
@justincormack
justincormack merged commit bdef7e8 into linuxkit:master Mar 12, 2026
25 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@christoph-zededa christoph-zededa mentioned this pull request Mar 12, 2026
env: move builder getenv out of cobra cmds #4206
Draft
@rucoder rucoder mentioned this pull request Mar 24, 2026
Makefile: use linuxkit env vars for org and builder config lf-edge/eve#5700
Merged
4 of 7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@justincormack justincormack justincormack approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@rucoder @justincormack
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.