Skip to content

Commit

Permalink
add SOURCE_DATE_EPOCH usage (ko-build#72)
Browse files Browse the repository at this point in the history
  • Loading branch information
zxxa authored and jonjohnsonjr committed Aug 16, 2019
1 parent b7eb9df commit bd404f3
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ 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.


### `ko publish`

`ko publish` simply builds and publishes images for each import path passed as
Expand Down Expand Up @@ -441,6 +440,14 @@ This resulting configuration may then be installed onto Kubernetes clusters via:
kubectl apply -f release.yaml
```

### Why are my images all created in 1970?

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

## Acknowledgements

Expand Down

0 comments on commit bd404f3

Please sign in to comment.