-
Notifications
You must be signed in to change notification settings - Fork 316
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a way to leverage external cache source in Docker export #7687
Comments
I misunderstood some things initially, it appears that So without buildkit being activated, we really only need a way to pass |
Another note: it is significant that |
Is this roughly the changes needed?
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. We value your input and contribution. Please leave a comment if this issue still affects you. |
This is still a major limitation of the feature that could be addressed with a simple passthrough flag |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. We value your input and contribution. Please leave a comment if this issue still affects you. |
1 similar comment
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. We value your input and contribution. Please leave a comment if this issue still affects you. |
The new
--multi-layer
option forhab pkg export docker
is really powerful, but it can't be taken advantage of in a CI environment where the Docker build cache isn't persisted between builds. Instead you end up with 90+ layer images that share nothing.Docker has a means of using "external cache sources" that can solve this. It involves passing
--build-arg BUILDKIT_INLINE_CACHE=1
todocker build
to trigger some additional metadata being written into the image, and then next time you rebuild the same image in a new environment, you candocker pull
the previous image and specify it via--cache-from
during the nextdocker build
.Currently, there is no way to pass either of these options to the underlying
docker build
call when usinghab pkg export docker --multi-layer
. Please either add a way to pass additional arbitrary params todocker build
(likeHAB_DOCKER_OPTS
does for studios) or add higher-level options for enabling an external caching workflowI haven't been able to identify any downside of
BUILDKIT_INLINE_CACHE
, other than it only being available in newer engines. Given that--multi-layer
is a newer feature behind an option, it might be worth considering having it setBUILDKIT_INLINE_CACHE
by default since the whole point of the feature is to maximize cache efficiency, so its output would always include caching metadata. The user should be able to specify--cache-from
manually as it will be the user's responsibility in a CI environment to pull a previous build into the local docker cache ahead of time, but it might also make sense for--multi-layer
to apply some magic when it's not manually specified like assuming a:latest
tag its about to update is a good cache source if it exists alreadyThe text was updated successfully, but these errors were encountered: