Closed dantonformaai closed 1 year ago
Hi @dantonformaai - I'm going to close this issue because it's not related to Docker Hub. You might try opening an issue in https://github.com/moby/buildkit
That said, you'll never have separate builds with the same hash due to timestamps. You may find researching "reproducible builds" to help if this is a necessity for you.
Problem description
Given this simplified
Dockerfile
:After running
docker build
twice and checking the hash of last layer for both created images usingdocker image inspect
we can see that hashes don't match.Checking the tar of both last layers we can see a single entry for
/etc
directory. I believe/etc
has been changed bydocker build
due deletion/creation of following files bydocker build
afterRUN|COPY|...
finishes:Executing
RUN touch -t 197001010000 /etc
is not able to fix the issue since/etc
is changed afterRUN
command finishes.Recreating images after execute
docker system prune
generates a whole new list of hashes for layers below FROM. When sending those recreated images toAmazon Elastic Container Registry
for example, all layers belowFROM
will be send again due new hash despite of content be the same except by attributes of/etc
. It causes waiting, bandwidth consumption and increasing storage usage.docker info
outputDocker Info:
Task List