Skip to content
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

Make it easier for image layers to overlap #1304

Closed
jonathan-boudreau-work opened this issue Sep 2, 2022 · 1 comment
Closed

Make it easier for image layers to overlap #1304

jonathan-boudreau-work opened this issue Sep 2, 2022 · 1 comment

Comments

@jonathan-boudreau-work
Copy link

Use case

On pull requests, we build images and push them to a registry. This is done to deploy to an environment temporarily. Unfortunately, the images are quite large, but bulk of the content doesn't change much.

We solved this issue by making the layers reproducible. If the blob is the same, then it will just be skipped when we upload the image, resulting in lower bandwidth / storage costs.

Currently this means having to use multi-stage builds to overwrite the file timestamps with touch -t all over the place. Its quite involved, and I think docker hub could benefit greatly from the reduced storage costs from something like this.

Proposal

Since this could be viewed as backward incompatible, a buildx build flag which automatically zeroes out the timestamps of files COPY'ed or ADD'ed into the image could be implemented to make it easier to have reproducible layer builds.

@tonistiigi
Copy link
Member

This is tracked in moby/buildkit#1058 and partially implemented in moby/buildkit#2918

You can also do this by using previous builds as a cache source with --cache-from. Then the layers are reused directly.

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

No branches or pull requests

2 participants