Skip to content

Commit 062f897

Browse files
authored
Merge pull request #3 from lexfrei/fix/arm64-support
fix: Use TARGETARCH for multi-platform builds
2 parents 23d9805 + 71eea82 commit 062f897

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Dockerfile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
ARG FROM=alpine
22
FROM $FROM AS cni
3-
ARG GOARCH=amd64
3+
# TARGETARCH is automatically set by Docker buildx for multi-platform builds
4+
ARG TARGETARCH
5+
ARG GOARCH=${TARGETARCH:-amd64}
46
ARG CNI_PLUGINS_VERSION=v1.1.1
57
RUN apk add --no-cache curl && \
68
curl -Lo cni.tar.gz https://github.com/containernetworking/plugins/releases/download/$CNI_PLUGINS_VERSION/cni-plugins-linux-$GOARCH-$CNI_PLUGINS_VERSION.tgz && \
79
tar -xf cni.tar.gz
810

911
FROM $FROM
10-
ARG GOARCH
12+
ARG TARGETARCH
13+
ARG GOARCH=${TARGETARCH:-amd64}
1114
ARG ALPINE_VERSION=v3.20
1215
LABEL maintainer="Cozystack <https://github.com/cozystack>"
1316
RUN echo -e "https://alpine.global.ssl.fastly.net/alpine/$ALPINE_VERSION/main\nhttps://alpine.global.ssl.fastly.net/alpine/$ALPINE_VERSION/community" > /etc/apk/repositories && \

0 commit comments

Comments
 (0)