Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: image creation not 1970 #1344

Open
eest opened this issue Jun 20, 2024 · 2 comments
Open

docs: image creation not 1970 #1344

eest opened this issue Jun 20, 2024 · 2 comments

Comments

@eest
Copy link

eest commented Jun 20, 2024

The FAQ has a note regarding "Why are my images all created in 1970?". When trying out ko for the first time recently I noticed the timestamp was indeed not "now", but it was not 1970 either.

In my case the magic timestamp from docker inspect was "Created": "2024-06-06T11:29:57Z", and some hair-pulling later I got a clue by running ko build with verbose logging:

KO_DOCKER_REPO=ko.local ko build -v 2>&1 | grep "2024-06-06T11:29:57Z"
{"architecture":"amd64","author":"github.com/chainguard-dev/apko","created":"2024-06-06T11:29:57Z","history":[{"author":"apko","created":"2024-06-06T11:29:57Z","created_by":"apko","comment":"This is an apko single-layer image"}],"os":"linux","rootfs":{"type":"layers","diff_ids":["sha256:c35c58ad774b9d0552e5b01f5b020ee1e835f310ce6b0bad8bd007512c7bbd80"]},"config":{"Env":["PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin","SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt"],"User":"65532"}}

So I assume what is happening is that my container will inherit the creation time of the base cgr.dev/chainguard/static:latest image. Maybe the FAQ should be updated to mention this?

@antweiss
Copy link

Just noticed this myself yesterday. Where is that FAQ you're referring to?
Also feels like this should be fixed in code instead of being noted in FAQ.
Image creation date is important.

@antweiss
Copy link

antweiss commented Jul 25, 2024

NVM, found the FAQ and I see it's fixable with an env var.
https://github.com/ko-build/ko/blob/main/docs/advanced/faq.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants