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.
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 -tall 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 buildflag which automatically zeroes out the timestamps of filesCOPY'ed orADD'ed into the image could be implemented to make it easier to have reproducible layer builds.