docker-library / httpd

Docker Official Image packaging for Apache HTTP Server
https://httpd.apache.org
Apache License 2.0
310 stars 345 forks source link

Build Timestamp #266

Closed Virsacer closed 2 months ago

Virsacer commented 2 months ago

Hi, I pulled the new image

image

but Docker inspect shows, that this image is almost 2 month old:

root@DOCKER ~ $ docker inspect httpd:2.4-alpine | grep -E 'httpd@sha256|Created'
            "httpd@sha256:1126743b13846fe049683762a8fccfbd4a3966040eb5ff38c785eceebf0fcce6"
        "Created": "2024-07-17T23:31:14Z",
root@DOCKER ~ $
tianon commented 2 months ago

We set SOURCE_DATE_EPOCH (buildkit docs) while building -- if you want to see the date the build was performed, you'll want to look at the org.opencontainers.image.created annotation we add in the image index (relevant code) instead: https://oci.dag.dev/?image=httpd:2.4-alpine ("org.opencontainers.image.created": "2024-09-06T23:20:57Z").

Virsacer commented 2 months ago

Thanks for the explanation I was confused by the fact, that docker images listed both the freshly downloaded and the previous image with CREATED "7 weeks ago"

tianon commented 2 months ago

Indeed, it's unfortunate -- I wish we could somehow have Docker show when we built it and still have the possibility of a reproducible build in the future. :disappointed:

Glad that answers your question!