-
Notifications
You must be signed in to change notification settings - Fork 405
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
Add SOURCE_DATE_EPOCH usage #72
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this -- suggested a bit more context and instructions for git users. I also might move this down to the bottom of the README as a small section titled ### Why are my images all created in 1970?
or something.
README.md
Outdated
@@ -124,6 +124,7 @@ However, these same commands can be directed to operate locally as well via | |||
the `--local` or `-L` command (or setting `KO_DOCKER_REPO=ko.local`). See | |||
the [`minikube` section](./README.md#with-minikube) for more detail. | |||
|
|||
The image when you use `ko` to create won't set the create timestamp in the image attribute. If you want to set the create timestamp, just execute SOURCE_DATE_EPOCH=`date +%s` on your environment before use `ko`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The image when you use `ko` to create won't set the create timestamp in the image attribute. If you want to set the create timestamp, just execute SOURCE_DATE_EPOCH=`date +%s` on your environment before use `ko`. | |
In order to support [reproducible builds](https://reproducible-builds.org), `ko` doesn't embed timestamps in the images it produces by default; however, `ko` does respect the [`SOURCE_DATE_EPOCH`](https://reproducible-builds.org/docs/source-date-epoch/) environment variable. | |
For example, you can set this to the current timestamp by executing: | |
export SOURCE_DATE_EPOCH=`date +%s | |
or to the latest git commit's timestamp with: | |
export SOURCE_DATE_EPOCH=$(git log -1 --format='%ct') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your review. I have already updated the readme. @jonjohnsonjr
234de32
to
7517717
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Describe
SOURCE_DATE_EPOCH
in the readme.