diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ffc74754..10d27b97 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -59,6 +59,7 @@ jobs: with: context: . file: ./Dockerfile + platforms: linux/amd64,linux/arm64 push: true build-args: | COMMIT_TAG=${{ github.sha }} diff --git a/Dockerfile b/Dockerfile index 52c23647..447734ac 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,20 @@ FROM node:14.16-alpine AS BUILD_IMAGE +ARG TARGETPLATFORM +ENV TARGETPLATFORM=${TARGETPLATFORM:-linux/amd64} + ARG COMMIT_TAG ENV COMMIT_TAG=${COMMIT_TAG} COPY . /app WORKDIR /app +RUN \ + case "${TARGETPLATFORM}" in \ + 'linux/arm64') apk add --no-cache python make g++ ;; \ + 'linux/arm/v7') apk add --no-cache python make g++ ;; \ + esac + RUN yarn --frozen-lockfile && \ yarn build