Buildkit: [img#165] Ability to build images offline

Created on 30 Oct 2018  路  3Comments  路  Source: moby/buildkit

cc @akshaymankar

enhancement exintermediate

Most helpful comment

I'd like to look into this, but I'm not really sure where to start. I think it's a pretty important feature to have for reproducible image building in CI.

The goal is to be able to track upstream images as dependencies and fetch them on our own accord (handling auth, etc. separately from buildkit) and then pass them on to buildkit. If there was some way to have buildkit load FROM images from local OCI image tarballs instead of fetching the image on its own, that would be perfect.

All 3 comments

This is not only ResolveModePreferLocal but ResolveModePreferLocal is a good example for how to do it. I think all the sources git/http/image (eg. LLB roots) should have a persistent LRU cache mechanism for resolving the cache key. Eg. from reference to digest on images, repo-url to commit sha on git, url to sha256 in http. Whenever a source is resolved it should add a record into that cache for future use. So in the case of images, while ResolveModePreferLocal requires a local image, this cache mechanism doesn't require the image to be present and only needs the digest to be resolved.

Should add a new flag that is exposed to all sources. Something like --validate-remote=required,fallback,offline where fallback would use cache when remote check failed.

Any update on this awesome feature?

I'd like to look into this, but I'm not really sure where to start. I think it's a pretty important feature to have for reproducible image building in CI.

The goal is to be able to track upstream images as dependencies and fetch them on our own accord (handling auth, etc. separately from buildkit) and then pass them on to buildkit. If there was some way to have buildkit load FROM images from local OCI image tarballs instead of fetching the image on its own, that would be perfect.

Was this page helpful?
0 / 5 - 0 ratings