Skip to content

Commit e2d0245

Browse files
authored
Update Dockerfile to support multiple architectures
1 parent fb53de5 commit e2d0245

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

Dockerfile

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,14 @@ RUN apt-get update \
1010
&& apt-get install -y --no-install-recommends ca-certificates curl tar \
1111
&& rm -rf /var/lib/apt/lists/*
1212

13-
RUN curl -fsSL "https://go.dev/dl/go${GO_VERSION}.linux-amd64.tar.gz" -o /tmp/go.tgz \
14-
&& rm -rf /usr/local/go \
15-
&& tar -C /usr/local -xzf /tmp/go.tgz \
16-
&& rm -f /tmp/go.tgz
13+
RUN ARCH=$(dpkg --print-architecture) && \
14+
if [ "$ARCH" = "amd64" ]; then GOARCH=amd64; \
15+
elif [ "$ARCH" = "arm64" ]; then GOARCH=arm64; \
16+
else echo "Unsupported arch: $ARCH" && exit 1; fi && \
17+
curl -fsSL "https://go.dev/dl/go${GO_VERSION}.linux-${GOARCH}.tar.gz" -o /tmp/go.tgz && \
18+
rm -rf /usr/local/go && \
19+
tar -C /usr/local -xzf /tmp/go.tgz && \
20+
rm -f /tmp/go.tgz
1721

1822
ENV PATH="/usr/local/go/bin:${PATH}"
1923
WORKDIR /src

0 commit comments

Comments
 (0)