Skip to content

Makefile: use linuxkit env vars for org and builder config#5669

Draft
rucoder wants to merge 1 commit intolf-edge:masterfrom
rucoder:rucoder/linuxkit-env-vars
Draft

Makefile: use linuxkit env vars for org and builder config#5669
rucoder wants to merge 1 commit intolf-edge:masterfrom
rucoder:rucoder/linuxkit-env-vars

Conversation

@rucoder
Copy link
Contributor

@rucoder rucoder commented Mar 12, 2026

Description

NOTES:

  1. LK is not released yet
  2. please review as if all LK commits are merged. this is IMO the way to drive CI
  3. sure the build fails since 1.8.3 (or whatever next version is) is not yet released

linuxkit v1.8.3 introduces native environment variable support for flags previously threaded through every linuxkit call site in this Makefile via LINUXKIT_ORG_TARGET and BUILDKIT_CONFIG_OPTS. This PR removes those Makefile-level workarounds and lets linuxkit pick up configuration directly from the runner environment.

Removed:

  • BUILDKIT_CONFIG_FILE / BUILDKIT_CONFIG_OPTS variables and the manifest-mode guard
  • LINUXKIT_ORG_TARGET variable and its injection at 9 call sites
  • REGISTRY make variable (was only used to feed LINUXKIT_ORG_TARGET)

New interface — set in the runner environment or on the make command line:

Purpose Old New
Custom push registry make REGISTRY=myregistry LINUXKIT_PKG_ORG=myregistry/lfedge make
buildkit registry mirrors BUILDKIT_CONFIG_FILE=/etc/buildkit/buildkitd.toml (auto-detected) LINUXKIT_BUILDER_CONFIG=/path/to/buildkitd.toml (explicit)
Pull-side registry mirrors not supported LINUXKIT_MIRROR=docker.io=http://my-mirror.local

A $(warning ...) is emitted if /etc/buildkit/buildkitd.toml exists on the local machine but LINUXKIT_BUILDER_CONFIG is not set, to avoid silently losing a previously auto-detected config.

Bumps LINUXKIT_VERSION to v1.8.3.

PR dependencies

Requires linuxkit v1.8.3 which includes:
linuxkit/linuxkit#4205

How to test and validate this PR

  1. Normal build — make without any overrides should behave identically to before.
  2. Custom registry — LINUXKIT_PKG_ORG=myregistry/lfedge make should tag/push packages to myregistry/lfedge/* (replaces make REGISTRY=myregistry).
  3. buildkit mirror — set LINUXKIT_BUILDER_CONFIG=/etc/buildkit/buildkitd.toml on a runner that has the file; verify buildkit uses the mirror config.
  4. Warning — create /etc/buildkit/buildkitd.toml locally without setting LINUXKIT_BUILDER_CONFIG; confirm the warning is printed.

Changelog notes

No user-facing changes. Build tooling simplification: linuxkit registry mirror and org configuration is now passed via environment variables (LINUXKIT_BUILDER_CONFIG, LINUXKIT_PKG_ORG, LINUXKIT_MIRROR) instead of make variables, making CI runner configuration more transparent.

PR Backports

  • 16.0-stable: No
  • 14.5-stable: No.
  • 13.4-stable: No.

Checklist

  • I've provided a proper description
  • I've added the proper documentation
  • I've tested my PR on amd64 device
  • I've tested my PR on arm64 device
  • I've written the test verification instructions
  • I've set the proper labels to this PR
  • I've checked the boxes above, or I've provided a good reason why I didn't check them.- [ ]

@rucoder rucoder requested a review from eriknordmark as a code owner March 12, 2026 11:08
@rucoder rucoder force-pushed the rucoder/linuxkit-env-vars branch 2 times, most recently from 5ed85e1 to 78c02a6 Compare March 12, 2026 11:12
@rucoder rucoder requested review from europaul and rene March 12, 2026 11:13
@rucoder rucoder marked this pull request as draft March 12, 2026 11:13
@rucoder rucoder force-pushed the rucoder/linuxkit-env-vars branch from 78c02a6 to e31be55 Compare March 12, 2026 11:15
endif

# Check for a custom registry (used for development purposes)
ifdef REGISTRY
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I personally like the REGISTRY variable, it's intuitive and easy to use (no need to provide the org). But if you are insist to remove it, then the documentation must be updated: https://github.com/lf-edge/eve/blob/master/docs/BUILD.md#using-a-local-container-registry

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rene i know you love it but I just wanted to make the experience consistent , I do not insist, we can keep it if you want but IMO it maybe introduce more confusion in the future

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, so update the documentation....

linuxkit v1.8.3 introduces environment variable support for flags
previously threaded through every linuxkit call site in this Makefile.

Remove LINUXKIT_ORG_TARGET and BUILDKIT_CONFIG_OPTS workarounds:
- Drop BUILDKIT_CONFIG_FILE / BUILDKIT_CONFIG_OPTS variables and the
  manifest-mode guard; replace with LINUXKIT_BUILDER_CONFIG env var
  which defaults to /etc/buildkit/buildkitd.toml if the file exists
- Drop LINUXKIT_ORG_TARGET from all linuxkit call sites (9 locations)
- Drop REGISTRY make variable; use LINUXKIT_PKG_ORG directly

Migration:
  make REGISTRY=myregistry  ->  LINUXKIT_PKG_ORG=myregistry/lfedge make

For buildkit registry mirrors, LINUXKIT_BUILDER_CONFIG auto-detects
/etc/buildkit/buildkitd.toml as before; override by setting
LINUXKIT_BUILDER_CONFIG explicitly in the environment.
For pull-side mirrors, set LINUXKIT_MIRROR in the runner environment.

Bump LINUXKIT_VERSION to v1.8.3.

Signed-off-by: Mikhail Malyshev <mike.malyshev@gmail.com>
@rucoder rucoder force-pushed the rucoder/linuxkit-env-vars branch from e31be55 to d522fbc Compare March 12, 2026 14:14
Copy link
Contributor

@europaul europaul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, I only wish LINUXKIT_BUILDER_CONFIG would be called BUILDKIT_CONFIG_PATH but I think it's too late for that :)

@rucoder
Copy link
Contributor Author

rucoder commented Mar 15, 2026

LGTM, I only wish LINUXKIT_BUILDER_CONFIG would be called BUILDKIT_CONFIG_PATH but I think it's too late for that :)

@europaul no, not to late. but it must be exactly BUILDKIT_CONFIG_PATH or LINUXKIT_BUILDER_CONFIG_PATH would work too? or BUILDKIT_CONFIG_PATH is some pre-defined buildkit variable?

@europaul
Copy link
Contributor

LGTM, I only wish LINUXKIT_BUILDER_CONFIG would be called BUILDKIT_CONFIG_PATH but I think it's too late for that :)

@europaul no, not to late. but it must be exactly BUILDKIT_CONFIG_PATH or LINUXKIT_BUILDER_CONFIG_PATH would work too? or BUILDKIT_CONFIG_PATH is some pre-defined buildkit variable?

It's just an arbitrary name but I think buildkit should be included instead of builder since it provides clarity as to what this config actually is. builder is too abstract

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants