Skip to content

Commit

Permalink
Use COPY --link to share Go layer across OS variants / updates
Browse files Browse the repository at this point in the history
This makes the Go layer reproducible such that re-pulling it can be avoided when switching between OS variants or OS updates.

```console
$ docker buildx build --builder foo --pull --build-arg BUILDKIT_SYNTAX=docker/dockerfile:1 1.21/alpine3.18 --quiet --output type=oci | tar -tv | grep a3881458cc9d5f6798ed03914b3fb322f3620ca53deca3b2c4460676912d16f5
-r--r--r-- 0/0        67061931 1969-12-31 16:00 blobs/sha256/a3881458cc9d5f6798ed03914b3fb322f3620ca53deca3b2c4460676912d16f5
$ docker buildx build --builder foo --pull --build-arg BUILDKIT_SYNTAX=docker/dockerfile:1 1.21/alpine3.19 --quiet --output type=oci | tar -tv | grep a3881458cc9d5f6798ed03914b3fb322f3620ca53deca3b2c4460676912d16f5
-r--r--r-- 0/0        67061931 1969-12-31 16:00 blobs/sha256/a3881458cc9d5f6798ed03914b3fb322f3620ca53deca3b2c4460676912d16f5
$ docker buildx build --builder foo --pull --build-arg BUILDKIT_SYNTAX=docker/dockerfile:1 1.21/bookworm --quiet --output type=oci | tar -tv | grep a3881458cc9d5f6798ed03914b3fb322f3620ca53deca3b2c4460676912d16f5
-r--r--r-- 0/0        67061931 1969-12-31 16:00 blobs/sha256/a3881458cc9d5f6798ed03914b3fb322f3620ca53deca3b2c4460676912d16f5
$ docker buildx build --builder foo --pull --build-arg BUILDKIT_SYNTAX=docker/dockerfile:1 1.21/bullseye --quiet --output type=oci | tar -tv | grep a3881458cc9d5f6798ed03914b3fb322f3620ca53deca3b2c4460676912d16f5
-r--r--r-- 0/0        67061931 1969-12-31 16:00 blobs/sha256/a3881458cc9d5f6798ed03914b3fb322f3620ca53deca3b2c4460676912d16f5
```
  • Loading branch information
yosifkit authored and tianon committed Jan 16, 2024
1 parent 09d6a0c commit 48d6c40
Show file tree
Hide file tree
Showing 14 changed files with 429 additions and 147 deletions.
39 changes: 33 additions & 6 deletions 1.20/alpine3.18/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

39 changes: 33 additions & 6 deletions 1.20/alpine3.19/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

54 changes: 39 additions & 15 deletions 1.20/bookworm/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

54 changes: 39 additions & 15 deletions 1.20/bullseye/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 26 additions & 6 deletions 1.21/alpine3.18/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 48d6c40

Please sign in to comment.