`docker history` shows `48 years ago`
Why does docker history gcr.io/distroless/base:latest show 48 years ago?
Could this be fixed?
$ docker pull gcr.io/distroless/base
Using default tag: latest
latest: Pulling from distroless/base
8f125ded1b48: Already exists
Digest: sha256:628939ac8bf3f49571d05c6c76b8688cb4a851af6c7088e599388259875bde20
Status: Downloaded newer image for gcr.io/distroless/base:latest
$ docker history gcr.io/distroless/base:latest
IMAGE CREATED CREATED BY SIZE COMMENT
1358ac6604c5 48 years ago bazel build ... 16.6MB
This is the same for gcr.io/distroless/python3.
I'm using Docker for Mac.
$ docker version
Client:
Version: 18.06.1-ce
API version: 1.38
Go version: go1.10.3
Git commit: e68fc7a
Built: Tue Aug 21 17:21:31 2018
OS/Arch: darwin/amd64
Experimental: false
Server:
Engine:
Version: 18.06.1-ce
API version: 1.38 (minimum version 1.12)
Go version: go1.10.3
Git commit: e68fc7a
Built: Tue Aug 21 17:29:02 2018
OS/Arch: linux/amd64
Experimental: true
Lol... Just ran into this too
I guess this is expected behavior. By setting a modification date to zero (48 years since 1970) to every file and container, builds are reproducible.
Distroless images are built via rules_docker. Please see this comment for an explanation: https://github.com/bazelbuild/rules_docker/issues/52#issuecomment-308490078
Images can be reproducible and have a date ≥0.
Despite that effort the image is not reproducible. If I re-run the build scripts today I get different layers: Package ca-certificates could have been changed in the meanwhile.
Therefore it's more sensible to set the datetime (and use tar's --sort=name --clamp-mtime --mtime=… and so forth) to the one of the most recently changed package. Indeed I recommend it to enable users to spot differences there early on (the hash is merely an indicator that something changed, but establishes no order and is of less use to a human).
(I've created reproducible images, albeit not for Docker but rkt.)
Also ran into this issue when I downloaded the distroless java.
docker history gcr.io/distroless/java
IMAGE CREATED CREATED BY SIZE COMMENT
f1692385bbb2 49 years ago bazel build ... 99.8MB
<missing> 49 years ago bazel build ... 1.93MB
<missing> 49 years ago bazel build ... 16.8MB
docker version
Client: Docker Engine - Community
Version: 18.09.0
API version: 1.39
Go version: go1.10.4
Git commit: 4d60db4
Built: Wed Nov 7 00:47:43 2018
OS/Arch: darwin/amd64
Experimental: false
Server: Docker Engine - Community
Engine:
Version: 18.09.0
API version: 1.39 (minimum version 1.12)
Go version: go1.10.4
Git commit: 4d60db4
Built: Wed Nov 7 00:55:00 2018
OS/Arch: linux/amd64
Experimental: true
Kubernetes:
Version: v1.10.3
StackAPI: v1beta2
Does debian export something we could use as the SOURCE_DATE_EPOCH?
Celebrating Golden Jubilee here for Unix epoch :fireworks: :champagne:
IMAGE ID CREATED SIZE
611284c694d9 50 years ago 2.89GB
2e228ed01a2d 50 years ago 428MB
d537bf2b5c5a 50 years ago 463MB
77fc0fc9c101 50 years ago 2.89GB
6811459889d8 50 years ago 287MB
f5a407b436d0 50 years ago 479MB
3de0bd6c1848 50 years ago 479MB
68d927088433 50 years ago 288MB
86c4a5fdbc89 50 years ago 611MB
495513bd8816 50 years ago 279MB
FOUR YEARS LATER...
And I thought that the insurance industry was slow to change...
Fun fact: the company where I work not only existed, but had her own Golden Jubilee in the year with which this GCR image was erroneously tagged:
$ docker pull gcr.io/distroless/base
[..]
$ docker images | grep distro
gcr.io/distroless/base latest 2e9fdb5bbbcb 52 years ago 20.3MB
54 years ago