Commit 16dbe96
committed
Enable multi-architecture docker image builds
Previously, the Dockerfile downloaded a 'docker-gen' binary during build
time. This caused a problem as it hard-coded the amd64 architecture for
the image.
This commit updates the Dockerfile to build the docker-gen executable
from source instead of downloading a binary. This updated Dockerfile
uses a multi-stage build [1]. The first stage downloads a source tarball
from github and produces a binary out of it. The second stage
corresponds to the old Dockerfile, with the sole change being that is
fetches the binary from the first stage instead of GitHub.
This has the advantage that the build process no longer assumes a
certain architecture and enables building the image for any architecture
that both the golang and alpine base images support.
[1] https://docs.docker.com/develop/develop-images/multistage-build/1 parent 4edc190 commit 16dbe96
1 file changed
+19
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
1 | 19 | | |
2 | 20 | | |
3 | 21 | | |
4 | 22 | | |
5 | 23 | | |
6 | 24 | | |
7 | | - | |
| 25 | + | |
8 | 26 | | |
9 | 27 | | |
10 | | - | |
11 | 28 | | |
12 | 29 | | |
0 commit comments