Skip to content

Commit 91b1b36

Browse files
authored
feat(backend): Adding Multi-CPU architecture support in Dockerfile.* files for supporting Arm64 platform (#12313)
Update backend/Dockerfile with "ARG TARGETARCH" to get docker's "--platform" parameters. it supports backend/Dockerfile to download the packages matched CPU architecture. Update backend/Dockerfile.driver and backend/Dockerfile.launcher by removing the parameter, GOARCH, Update Dockerfile.driver Update Dockerfile.launcher Signed-off-by: jtu-ampere <[email protected]>
1 parent 70819e0 commit 91b1b36

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

backend/Dockerfile

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,15 @@ RUN wget https://bootstrap.pypa.io/get-pip.py && python3 get-pip.py
3434
COPY backend/requirements.txt .
3535
RUN python3 -m pip install -r requirements.txt --no-cache-dir
3636

37+
ARG TARGETARCH
38+
RUN echo "Building for architecture: ${TARGETARCH}"
39+
3740
# Downloading Argo CLI so that the samples are validated
3841
ENV ARGO_VERSION=v3.6.7
39-
RUN curl -sLO https://github.com/argoproj/argo-workflows/releases/download/${ARGO_VERSION}/argo-linux-amd64.gz && \
40-
gunzip argo-linux-amd64.gz && \
41-
chmod +x argo-linux-amd64 && \
42-
mv ./argo-linux-amd64 /usr/local/bin/argo
42+
RUN curl -sLO https://github.com/argoproj/argo-workflows/releases/download/${ARGO_VERSION}/argo-linux-$TARGETARCH.gz && \
43+
gunzip argo-linux-$TARGETARCH.gz && \
44+
chmod +x argo-linux-$TARGETARCH && \
45+
mv ./argo-linux-$TARGETARCH /usr/local/bin/argo
4346

4447
WORKDIR /
4548
COPY ./samples /samples

backend/Dockerfile.driver

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ RUN GO111MODULE=on go mod download
2727

2828
COPY . .
2929

30-
RUN GO111MODULE=on CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -tags netgo -gcflags="${GCFLAGS}" -ldflags '-extldflags "-static"' -o /bin/driver ./backend/src/v2/cmd/driver/*.go
30+
RUN GO111MODULE=on CGO_ENABLED=0 GOOS=linux go build -tags netgo -gcflags="${GCFLAGS}" -ldflags '-extldflags "-static"' -o /bin/driver ./backend/src/v2/cmd/driver/*.go
3131

3232
FROM alpine:3.19
3333

backend/Dockerfile.launcher

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ RUN GO111MODULE=on go mod download
2525

2626
COPY . .
2727

28-
RUN GO111MODULE=on CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -tags netgo -ldflags '-extldflags "-static"' -o /bin/launcher-v2 ./backend/src/v2/cmd/launcher-v2/*.go
28+
RUN GO111MODULE=on CGO_ENABLED=0 GOOS=linux go build -tags netgo -ldflags '-extldflags "-static"' -o /bin/launcher-v2 ./backend/src/v2/cmd/launcher-v2/*.go
2929

3030
FROM alpine:3.19
3131

0 commit comments

Comments
 (0)