Skip to content

Commit 1666929

Browse files
committed
Add default value and docs for TARGETARCH
Signed-off-by: Kohei Tokunaga <[email protected]>
1 parent 51de235 commit 1666929

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ ARG CONTAINERD_VERSION=v1.4.3
1616
ARG RUNC_VERSION=v1.0.0-rc92
1717
ARG CNI_PLUGINS_VERSION=v0.9.0
1818

19+
# Legacy builder that doesn't support TARGETARCH should set this explicitly using --build-arg.
20+
# If TARGETARCH isn't supported by the builder, the default value is "amd64".
21+
1922
FROM golang:1.13-buster AS golang-base
2023

2124
# Build containerd
@@ -87,7 +90,7 @@ RUN apt-get update && apt-get install -y iptables && \
8790
# c.f. https://github.com/moby/moby/issues/26824
8891
update-alternatives --set iptables /usr/sbin/iptables-legacy && \
8992
mkdir -p /opt/cni/bin && \
90-
curl -Ls https://github.com/containernetworking/plugins/releases/download/${CNI_PLUGINS_VERSION}/cni-plugins-linux-${TARGETARCH}-${CNI_PLUGINS_VERSION}.tgz | tar xzv -C /opt/cni/bin
93+
curl -Ls https://github.com/containernetworking/plugins/releases/download/${CNI_PLUGINS_VERSION}/cni-plugins-linux-${TARGETARCH:-amd64}-${CNI_PLUGINS_VERSION}.tgz | tar xzv -C /opt/cni/bin
9194

9295
# Image which can be used as containerized `ctr-remote images optimize` command
9396
FROM ubuntu:20.04 AS oind

0 commit comments

Comments
 (0)