Skip to content

Commit 9aaa758

Browse files
committed
Add "buildx" and "compose" CLI plugins (for supported architectures of each)
1 parent 51f3e36 commit 9aaa758

File tree

4 files changed

+348
-12
lines changed

4 files changed

+348
-12
lines changed

20.10/Dockerfile

Lines changed: 80 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Dockerfile.template

Lines changed: 64 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,25 +18,33 @@ ENV DOCKER_VERSION {{ .version }}
1818
# https://github.com/docker/docker-ce/blob/5b073ee2cf564edee5adca05eee574142f7627bb/components/packaging/static/hash_files !!
1919
# (no SHA file artifacts on download.docker.com yet as of 2017-06-07 though)
2020

21+
{{
22+
def apkArch:
23+
{
24+
# https://dl-cdn.alpinelinux.org/alpine/edge/main/
25+
# https://wiki.alpinelinux.org/wiki/Architecture#Alpine_Hardware_Architecture_.28.22arch.22.29_Support
26+
# https://pkgs.alpinelinux.org/packages ("Arch" dropdown)
27+
amd64: "x86_64",
28+
arm32v6: "armhf",
29+
arm32v7: "armv7",
30+
arm64v8: "aarch64",
31+
i386: "x86",
32+
ppc64le: "ppc64le",
33+
riscv64: "riscv64",
34+
s390x: "s390x",
35+
}[.]
36+
-}}
2137
RUN set -eux; \
2238
\
2339
apkArch="$(apk --print-arch)"; \
2440
case "$apkArch" in \
2541
{{
2642
[
2743
.arches | to_entries[]
28-
| select(.value.dockerUrl and (.key | startswith("windows-") | not))
2944
| .key as $bashbrewArch
30-
| (
31-
{
32-
amd64: "x86_64",
33-
arm32v6: "armhf",
34-
arm32v7: "armv7",
35-
arm64v8: "aarch64",
36-
}
37-
| .[$bashbrewArch] // $bashbrewArch
38-
) as $apkArch
45+
| ($bashbrewArch | apkArch) as $apkArch
3946
| .value
47+
| select($apkArch and .dockerUrl)
4048
| (
4149
-}}
4250
{{ $apkArch | @sh }}) \
@@ -60,6 +68,52 @@ RUN set -eux; \
6068
\
6169
dockerd --version; \
6270
docker --version
71+
{{
72+
{
73+
buildx: .buildx,
74+
compose: .compose,
75+
}
76+
| to_entries | map(
77+
.key as $key | .value | (
78+
-}}
79+
80+
ENV DOCKER_{{ $key | ascii_upcase }}_VERSION {{ .version }}
81+
RUN set -eux; \
82+
apkArch="$(apk --print-arch)"; \
83+
case "$apkArch" in \
84+
{{
85+
.arches | to_entries | map(
86+
.key as $bashbrewArch
87+
| ($bashbrewArch | apkArch) as $apkArch
88+
| .value
89+
| select($apkArch and .url and .sha256)
90+
| (
91+
-}}
92+
{{ $apkArch | @sh }}) \
93+
url={{ .url | @sh }}; \
94+
sha256={{ .sha256 | @sh }}; \
95+
;; \
96+
{{
97+
)
98+
) | add
99+
-}}
100+
*) echo >&2 "warning: unsupported {{ $key }} architecture ($apkArch); skipping"; exit 0 ;; \
101+
esac; \
102+
plugin='/usr/libexec/docker/cli-plugins/docker-{{ $key }}'; \
103+
mkdir -p "$(dirname "$plugin")"; \
104+
wget -O "$plugin" "$url"; \
105+
echo "$sha256 *$plugin" | sha256sum -c -; \
106+
chmod +x "$plugin"; \
107+
{{ if $key == "compose" then ( -}}
108+
ln -sv "$plugin" /usr/local/bin/; \
109+
docker-{{ $key }} --version; \
110+
{{ ) else "" end -}}
111+
docker {{ $key }} version
112+
{{
113+
)
114+
)
115+
| add
116+
-}}
63117

64118
COPY modprobe.sh /usr/local/bin/modprobe
65119
COPY docker-entrypoint.sh /usr/local/bin/

versions.json

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,106 @@
2020
"dockerUrl": "https://download.docker.com/win/static/stable/x86_64/docker-20.10.15.zip"
2121
}
2222
},
23+
"buildx": {
24+
"arches": {
25+
"amd64": {
26+
"file": "buildx-v0.8.2.linux-amd64",
27+
"sha256": "c64de4f3c30f7a73ff9db637660c7aa0f00234368105b0a09fa8e24eebe910c3",
28+
"url": "https://github.com/docker/buildx/releases/download/v0.8.2/buildx-v0.8.2.linux-amd64"
29+
},
30+
"arm32v6": {
31+
"file": "buildx-v0.8.2.linux-arm-v6",
32+
"sha256": "d0e5d19cd67ea7a351e3bfe1de96f3d583a5b80f1bbadd61f7adcd61b147e5f5",
33+
"url": "https://github.com/docker/buildx/releases/download/v0.8.2/buildx-v0.8.2.linux-arm-v6"
34+
},
35+
"arm32v7": {
36+
"file": "buildx-v0.8.2.linux-arm-v7",
37+
"sha256": "b5bb1e28e9413a75b2600955c486870aafd234f69953601eecc3664bd3af7463",
38+
"url": "https://github.com/docker/buildx/releases/download/v0.8.2/buildx-v0.8.2.linux-arm-v7"
39+
},
40+
"arm64v8": {
41+
"file": "buildx-v0.8.2.linux-arm64",
42+
"sha256": "304d3d9822c75f98ad9cf57f0c234bcf326bbb96d791d551728cadd72a7a377f",
43+
"url": "https://github.com/docker/buildx/releases/download/v0.8.2/buildx-v0.8.2.linux-arm64"
44+
},
45+
"ppc64le": {
46+
"file": "buildx-v0.8.2.linux-ppc64le",
47+
"sha256": "32b317d86c700d920468f162f93ae2282777da556ee49b4329f6c72ee2b11b85",
48+
"url": "https://github.com/docker/buildx/releases/download/v0.8.2/buildx-v0.8.2.linux-ppc64le"
49+
},
50+
"riscv64": {
51+
"file": "buildx-v0.8.2.linux-riscv64",
52+
"sha256": "76d5fcf92ffa31b3e470d8ec1ab11f7b6997729e5c94d543fec765ad79ad0630",
53+
"url": "https://github.com/docker/buildx/releases/download/v0.8.2/buildx-v0.8.2.linux-riscv64"
54+
},
55+
"s390x": {
56+
"file": "buildx-v0.8.2.linux-s390x",
57+
"sha256": "ec4bb6f271f38dca5a377a70be24ee2108a85f6e6ba511ad3b805c4f1602a0d2",
58+
"url": "https://github.com/docker/buildx/releases/download/v0.8.2/buildx-v0.8.2.linux-s390x"
59+
},
60+
"windows-amd64": {
61+
"file": "buildx-v0.8.2.windows-amd64.exe",
62+
"sha256": "abd54d5a589c7745b67990b4fdbd489c922864e3725353faf6859ceed835dd4a",
63+
"url": "https://github.com/docker/buildx/releases/download/v0.8.2/buildx-v0.8.2.windows-amd64.exe"
64+
},
65+
"windows-arm64v8": {
66+
"file": "buildx-v0.8.2.windows-arm64.exe",
67+
"sha256": "8fe575d9346d30e97240ee0dd85c22b5974e8ee898a5fd26ab0d7e6792bc3cf8",
68+
"url": "https://github.com/docker/buildx/releases/download/v0.8.2/buildx-v0.8.2.windows-arm64.exe"
69+
}
70+
},
71+
"version": "0.8.2"
72+
},
73+
"compose": {
74+
"arches": {
75+
"amd64": {
76+
"file": "docker-compose-linux-x86_64",
77+
"sha256": "6296d17268c77a7159f57f04ed26dd2989f909c58cca4d44d1865f28bd27dd67",
78+
"url": "https://github.com/docker/compose/releases/download/v2.5.0/docker-compose-linux-x86_64"
79+
},
80+
"arm32v6": {
81+
"file": "docker-compose-linux-armv6",
82+
"sha256": "92b423e2c4d0ca0a979d7b6a4fb13707612f8fa19b900bc6cd1c2cf83f2780c5",
83+
"url": "https://github.com/docker/compose/releases/download/v2.5.0/docker-compose-linux-armv6"
84+
},
85+
"arm32v7": {
86+
"file": "docker-compose-linux-armv7",
87+
"sha256": "d728dcbe5e20103e9b025efdbb6bfbca9ea9866851e669f7775fe3ebb7ab945c",
88+
"url": "https://github.com/docker/compose/releases/download/v2.5.0/docker-compose-linux-armv7"
89+
},
90+
"arm64v8": {
91+
"file": "docker-compose-linux-aarch64",
92+
"sha256": "7efc61cc85fe712f14f04a6886d1481c96fe958be265f67482583b4b713b6a22",
93+
"url": "https://github.com/docker/compose/releases/download/v2.5.0/docker-compose-linux-aarch64"
94+
},
95+
"darwin-amd64": {
96+
"file": "docker-compose-darwin-x86_64",
97+
"sha256": "230e50b7f4bfc1705adb60cc5645df37a09873882230d60cc1ae20ba3099c521",
98+
"url": "https://github.com/docker/compose/releases/download/v2.5.0/docker-compose-darwin-x86_64"
99+
},
100+
"darwin-arm64v8": {
101+
"file": "docker-compose-darwin-aarch64",
102+
"sha256": "6b2d97d7b48c66930d1c9e4b81e4526e059b68a18c98d4ff862b4ca28f345c9a",
103+
"url": "https://github.com/docker/compose/releases/download/v2.5.0/docker-compose-darwin-aarch64"
104+
},
105+
"ppc64le": {
106+
"file": "docker-compose-linux-ppc64le",
107+
"sha256": "e40af00a5f3ef87d31372f949134411b574042b8c055b2e5da12b92192405cb6",
108+
"url": "https://github.com/docker/compose/releases/download/v2.5.0/docker-compose-linux-ppc64le"
109+
},
110+
"s390x": {
111+
"file": "docker-compose-linux-s390x",
112+
"sha256": "c36e48910f095d07d582b69363fb3f902bb6fab9e2bd3d5ed82a67d1b2279a39",
113+
"url": "https://github.com/docker/compose/releases/download/v2.5.0/docker-compose-linux-s390x"
114+
},
115+
"windows-amd64": {
116+
"file": "docker-compose-windows-x86_64.exe",
117+
"sha256": "83b4ce5911505edc7164650e9edf480e042baf6cb45293297ad57592d56947db",
118+
"url": "https://github.com/docker/compose/releases/download/v2.5.0/docker-compose-windows-x86_64.exe"
119+
}
120+
},
121+
"version": "2.5.0"
122+
},
23123
"dindCommit": "42b1175eda071c0e9121e1d64345928384a93df1",
24124
"variants": [
25125
"",

0 commit comments

Comments
 (0)