Skip to content

pkg build: fix builder config and certs not copied into new containers#4207

Merged
justincormack merged 1 commit into
linuxkit:masterfrom
europaul:fix/load-files-into-container
Mar 18, 2026
Merged

pkg build: fix builder config and certs not copied into new containers#4207
justincormack merged 1 commit into
linuxkit:masterfrom
europaul:fix/load-files-into-container

Conversation

@europaul

Copy link
Copy Markdown
Contributor

- What I did

Fixed the bug: builder config and certs were not copied into new container when a non-standard config was used.

- How I did it

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.

- How to verify it

Run linuxkit pkg build with some LINUXKIT_BUILDER_CONFIG set

- Description for the changelog

fix builder config and certs not copied into new containers

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>
@rucoder

rucoder commented Mar 14, 2026

Copy link
Copy Markdown
Contributor

@europaul cool! @justincormack @deitch could you please review this?

@justincormack justincormack merged commit 4cfb70d into linuxkit:master Mar 18, 2026
25 checks passed
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