calm-librarian-70577
02/14/2025, 10:03 AM.pex
file from the SOURCE_DATE_EPOCH
envvar correctly. However, the timestamp of the .pex
file itself will always update. COPY
-ing it in a Dockerfile will therefore create a new sha every time, making it uncachable. I need to somehow fix up the timestamp of the .pex
file post-pex-build and pre-docker-build within the package
goal. My problem is that I don't even know how I'd approach this problem. Any ideas? (Convincing Pex to timestamp the file correctly would of course also fix the problem.)gorgeous-winter-99296
02/14/2025, 1:52 PMoutput={"type":"docker","rewrite-timestamp":"true"}
in your BUILD file should resolve this if SOURCE_DATE_EPOCH is also set, as far as I know -- but I also see that you've visited that discussion already.gorgeous-winter-99296
02/14/2025, 1:56 PMcurved-manchester-66006
02/14/2025, 5:53 PMcalm-librarian-70577
02/15/2025, 10:29 AMbuildx
vs buildctl
elude me for the moment. The metadata on the image changes to 0 but the files inside don't. Anyway, I'll keep at it at report back.gorgeous-winter-99296
02/15/2025, 10:33 AMdocker
ecosystem years ago (just about when docker-swarm became "old"). Though the same issues exist for other tooling... Just easier with pure OCI containers.calm-librarian-70577
02/18/2025, 10:15 AMgorgeous-winter-99296
02/18/2025, 10:53 AMcalm-librarian-70577
02/22/2025, 3:40 PMSOURCE_DATE_EPOCH
does indeed work correctly. But only when built with docker buildx build
with any non-integrated builder. It doesn't work with normal docker build
(which uses integrated buildkit in the current version, even without DOCKER_BUILDKIT=1). Neither does it work with docker buildx build
with the default builder. Only after doing docker buildx create --use --driver-opt image=moby/buildkit --name buildkit
and using that builder does it start working properly.
Next week I'll see if I can add some illumination in some issues for other people that might run into this, with Pants specifically.gorgeous-winter-99296
02/22/2025, 3:42 PM