Skip to content

Conversation

@danrzs
Copy link
Contributor

@danrzs danrzs commented Jun 27, 2025

- What I did

Modified docs/image-cache.md to note how one can export from a local docker instance into linuxkit
closes #4126

- How I did it

NA

- How to verify it

NA

- Description for the changelog

Add instructions for importing images from local docker instance

- A picture of a cute animal (not mandatory but encouraged)

image

linuxkit cache import foo.tar
```

Note that this process only works for the platform/architecture you're currently on - it won’t produce multi-platform images (without extra efforts). For that, you'd need to push to a registry and LinuxKit pull as normal.
Copy link
Collaborator

Choose a reason for hiding this comment

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

This line is not completely correct. You can produce multi-platform images this way using a docker-container builder (actually, this is exactly how linuxkit pkg build does it). You just need to do --platform linux/amd64,linux/arm64,etc.

Maybe just remove this line?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

apologies - it was more "the above, as described". I presume diff arches would need some underlying qemu magic to assist the builds too?

I'll reword slightly to indicate something closer to the truth.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done.

Copy link
Collaborator

Choose a reason for hiding this comment

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

magic to assist the builds too?

Depends on the case. If you use docker desktop, it already is done. You are right, though, there is more to do. Well, sort of. If you use some of buildkit's capabilities for cross-compiling, you might never need emulation.

OK, I am getting way too far into the weeds for this. If you want to discuss cross-builds on Slack, more than happy to. :-)

Copy link
Collaborator

Choose a reason for hiding this comment

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

FYI, for builds, I often use linuxkit pkg build as an opinionated version. It builds multiple platforms, stores in a the cache, etc.

@danrzs danrzs force-pushed the docs/docker-save-in-cache branch from 53770a1 to 6b067a6 Compare June 30, 2025 08:22
@deitch deitch merged commit 818bccf into linuxkit:master Jun 30, 2025
22 checks passed
@deitch
Copy link
Collaborator

deitch commented Jun 30, 2025

In any case, thank you for this.

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.

Docker saved tarballs cannot be used with linuxkit cache

2 participants