You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+126Lines changed: 126 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -110,3 +110,129 @@ See the `docker://` example above, and read `docker` as `podman`.
110
110
111
111
### Accessing private images
112
112
To access private images, create a credential file as `~/.docker/config.json` using `docker login`.
113
+
114
+
115
+
- - -
116
+
# Examples
117
+
## Non-reproducible Docker Hub images
118
+
119
+
### `golang:1.21-alpine3.18`
120
+
The sources of the official Docker Hub images are available at <https://github.com/docker-library>.
121
+
122
+
For example, the source of [`golang:1.21-alpine3.18`](https://hub.docker.com/layers/library/golang/1.21-alpine3.18/images/sha256-dd8888bb7f1b0b05e1e625aa29483f50f38a9b64073a4db00b04076cec52b71c?context=explore)
123
+
can be found at <https://github.com/docker-library/golang/blob/d1ff31b86b23fe721dc65806cd2bd79a4c71b039/1.21/alpine3.18/Dockerfile>.
Layer ctx:/layers-3/layer length mismatch (4 vs 3)
158
+
Layer ctx:/layers-3/layer name "go/.wh..wh..opq" only appears in input 0
159
+
```
160
+
161
+
> **Note**
162
+
> The `--semantic` flag is specified to ignore differences of timestamps, image names, and other "boring" attributes.
163
+
> Without this flag, the `diffoci` command may print an enourmous amount of output.
164
+
165
+
In the `my-golang-1.21-alpine3.18` image, special files called ["Opaque whiteouts"](https://github.com/opencontainers/image-spec/blob/v1.0.2/layer.md#whiteouts) (`.wh..wh..opq`)
166
+
are missing due to filesystem difference between Docker Hub's build machine and the local machine.
167
+
168
+
Also, the `lib/apk/db/scripts.tar` file in the layer 1 is not reproducible due to the timestamps of the tar entries inside it.
169
+
The differences can be inspected by running the [`diffoscope`](https://diffoscope.org/) command for `~/diff/input-{0,1}/layers-1/lib/apk/db/scripts.tar`:
These differences are boring, but not filtered out by the `--semantic` flag of the `diffoci` command, because `diffoci` is not aware of the formats of the files inside the image layers.
199
+
200
+
The `lib/apk/db/scripts.tar` file in the layer 2 has the same issue:
Depending on the time to build the image, more differences may happen, especially when the Alpine packages on the internet are bumped up.
234
+
235
+
#### Conclusion
236
+
This example indicates that although the official `golang:1.21-alpine3.18` image binary is not fully reproducible, its non-reproducibility is practically negligible, and
237
+
this image binary can be assured to be certainly built from with the [published source](https://github.com/docker-library/golang/blob/d1ff31b86b23fe721dc65806cd2bd79a4c71b039/1.21/alpine3.18/Dockerfile).
238
+
**If the published source is trustable**, this image binary can be trusted too.
0 commit comments