add support for building from cached images#3797
Conversation
66b73d9 to
9e9d4c6
Compare
|
This is not quite going to be ready yet. We need to run a version of buildkit container that supports this. Unfortunately, there only is semver (most recent is |
9e9d4c6 to
5b46ed2
Compare
|
tests are correct now, but it will fail, because the buildkit image being run is |
5b46ed2 to
6d13af8
Compare
59e6855 to
f3fa673
Compare
Signed-off-by: Avi Deitcher <[email protected]>
f3fa673 to
a90ff54
Compare
|
It is quite strange, but I cannot build for another platform (I am on amd64) when starting from empty |
|
Really strange @giggsoff ; I cannot replicate it. I tried both with and without |
|
We are going to merge this in soon. Once it is, if you can replicate it, we will open a new issue to focus on it. |
|
been open for almost 3 weeks, CI green for a week, and @justincormack wrote:
If anyone has issues with this, take it up with me on Slack. |
Signed-off-by: Avi Deitcher [email protected]
- What I did
Enable linuxkit to use images from the cache. This makes the behaviour exactly like docker, and resolves a very longstanding issue.
If you do
linuxkit pkg build ./pkg/foowhich outputs, say,linuxkit/foo:abcd(based onbuild.yaml), and you want to use that image in your next build without first pushing it to the registry, it wouldn't work. E.g.:FROM linuxkit/foo:abcdThis adds support for reading it from the local cache. It also gives you the ability to override that and ignore the local cache with
--ignore-cached, so the behaviour is:lkt pkg build dir/- build based ondir/, and for allFROMimages in the dockerfile, first look in the linuxkit cache, and only after at the remote registrylkt pkg build --ignore-cached dir/- build based ondir/, but do not try to load any images from the local linuxkit cache.- How I did it
Leverage the most recent #3791 to use recent improvements in buildkit to read from OCI layout caches.
- How to verify it
CI. I added a test for it.
- Description for the changelog
Ability to use images in linuxkit cache when building packages