full-nightfall-13189
01/14/2025, 1:51 AMfull-nightfall-13189
01/14/2025, 1:56 AMpants.toml
, set:
[docker]
use_buildx = true
build_args = ["SOURCE_DATE_EPOCH"]
env_vars = [
"SOURCE_DATE_EPOCH",
]
⢠Create .pants.bootstrap
with:
export SOURCE_DATE_EPOCH=$(git log -1 --format='%at')
⢠Added the following to docker_image()
target:
output={
"type": "docker", # Default output type.
"rewrite-timestamp": "true"
},
⢠Added the SOURCE_DATE_EPOCH
to my Dockerfile.full-nightfall-13189
01/14/2025, 1:56 AMfull-nightfall-13189
01/14/2025, 2:02 AM--docker-build-verbose
and I can see that it sets SOURCE_DATE_EPOCH
correctly and it rewrites the timestamps as well.full-nightfall-13189
01/14/2025, 8:41 PMfierce-truck-19259
01/14/2025, 11:52 PMfierce-truck-19259
01/15/2025, 12:03 AMdocker inspect
the image across two runs to see what differs, probably metadata, if layer contents are the samefull-nightfall-13189
01/15/2025, 2:19 PMfull-nightfall-13189
01/15/2025, 2:20 PMdocker inspect
.curved-manchester-66006
01/15/2025, 6:30 PMfull-nightfall-13189
01/15/2025, 9:01 PMdocker_image
target), results in an image with different IDs.full-nightfall-13189
01/15/2025, 9:04 PMdocker inspect
on the images generated from https://github.com/pantsbuild/pants/issues/20699 shows that everything matches (except Metadata.LastTagTime
but I guess this isn't used in the sha calculation).
The images generated with pants only differ in Id
, RepoDigests1
& LastTagTime
, nothing else...full-nightfall-13189
01/16/2025, 6:39 PMfierce-truck-19259
01/17/2025, 3:55 PMsha1sum your-pex-file.pex
across runs of pants build
of those to make sure the input to the dockerfiles are not unstable in themselvesfierce-truck-19259
01/17/2025, 3:58 PMfierce-truck-19259
01/17/2025, 4:07 PMbut I guess this isn't used in the sha calculation).no but something else probably changed to affect the digest of the image
fierce-truck-19259
01/17/2025, 4:08 PMfull-nightfall-13189
01/17/2025, 6:38 PMfierce-truck-19259
01/17/2025, 6:47 PM