From 90957287190f9b3b5e1f59204d6f85a21cd66b57 Mon Sep 17 00:00:00 2001 From: Dr-Electron Date: Mon, 4 Mar 2024 00:35:52 +0100 Subject: [PATCH 1/2] Add ARM support --- .github/workflows/build-images.reusable.yaml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-images.reusable.yaml b/.github/workflows/build-images.reusable.yaml index c4c0dac93..3acab0a97 100644 --- a/.github/workflows/build-images.reusable.yaml +++ b/.github/workflows/build-images.reusable.yaml @@ -16,7 +16,10 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 - name: Set up Node.js uses: actions/setup-node@v3 @@ -27,16 +30,17 @@ jobs: uses: docker/setup-buildx-action@v3 - name: Login to Docker Hub - uses: docker/login-action@v1 + uses: docker/login-action@v3 with: username: ${{ secrets.IOTALEDGER_DOCKER_USERNAME }} password: ${{ secrets.IOTALEDGER_DOCKER_PASSWORD }} - name: Build and push Docker image for ${{ inputs.directory }} - uses: docker/build-push-action@v2 + uses: docker/build-push-action@v5 with: context: ./${{ inputs.directory }} file: ./${{ inputs.directory }}/Dockerfile + platforms: linux/amd64,linux/arm64 push: true tags: ${{ inputs.image_tags }} no-cache: true From 0ace6524e701bb9a56b0dcc1f1c8f5c310e3fca2 Mon Sep 17 00:00:00 2001 From: Dr-Electron Date: Mon, 4 Mar 2024 01:12:13 +0100 Subject: [PATCH 2/2] Change max sockets --- api/Dockerfile | 3 ++- client/Dockerfile | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/api/Dockerfile b/api/Dockerfile index 9d76f4658..345879e0f 100644 --- a/api/Dockerfile +++ b/api/Dockerfile @@ -13,7 +13,8 @@ COPY . ./ ARG CONFIG_ID # Install all packages necessary for compilation, build, then remove the devDependencies -RUN npm install +# Seems to fail for arm64 images if maxsockets is not set to 1. https://github.com/npm/cli/issues/4652#issuecomment-1157594100 +RUN npm install --maxsockets 1 RUN npm run build-compile RUN npm run build-config RUN npm prune --production diff --git a/client/Dockerfile b/client/Dockerfile index 76e53ed49..b6af428e2 100644 --- a/client/Dockerfile +++ b/client/Dockerfile @@ -25,7 +25,8 @@ RUN echo 'server {\ }' > /etc/nginx/sites-available/default # Running required steps to prepare the web app prod build -RUN npm install +# Seems to fail for arm64 images if maxsockets is not set to 1. https://github.com/npm/cli/issues/4652#issuecomment-1157594100 +RUN npm install --maxsockets 1 RUN npm run build # Expose port 80