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

Add SOURCE_DATE_EPOCH usage #72

Merged
merged 1 commit into from
Aug 16, 2019

Conversation

zxDiscovery
Copy link

Describe SOURCE_DATE_EPOCH in the readme.

Copy link
Collaborator

@jonjohnsonjr jonjohnsonjr left a 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`.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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')

Copy link
Author

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

Copy link
Collaborator

@jonjohnsonjr jonjohnsonjr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@jonjohnsonjr jonjohnsonjr merged commit bd404f3 into ko-build:master Aug 16, 2019
@zxDiscovery zxDiscovery deleted the updatereadme branch August 19, 2019 01:41
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

Successfully merging this pull request may close these issues.

2 participants