From b627d05b0595ec4a5ee052128a54f8b1284b530a Mon Sep 17 00:00:00 2001 From: pookie Date: Thu, 22 Feb 2024 14:14:52 -0800 Subject: [PATCH 1/5] adding arm platform --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 8f9c2ca..7453d85 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -56,5 +56,5 @@ jobs: context: workers/${{ matrix.service }} tags: ${{ steps.docker_meta.outputs.tags }}, ashirt/${{ matrix.service }}:latest #Add latest tag for main labels: ${{ steps.docker_meta.outputs.labels }} - platforms: linux/amd64 + platforms: linux/amd64,linux/arm64 push: true From 87efdfd74bc6bbce749686d10a78bea2fea11d72 Mon Sep 17 00:00:00 2001 From: pookie Date: Thu, 22 Feb 2024 14:22:25 -0800 Subject: [PATCH 2/5] adding qemu --- .github/workflows/ci.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 7453d85..608328d 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -35,6 +35,8 @@ jobs: with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx id: buildx uses: docker/setup-buildx-action@v3.0.0 From dc7b588089fb2a62c5296e0c886e10cf4af0b9e2 Mon Sep 17 00:00:00 2001 From: pookie Date: Thu, 22 Feb 2024 14:31:44 -0800 Subject: [PATCH 3/5] adding arm platform --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 608328d..48545d7 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -48,7 +48,7 @@ jobs: context: workers/${{ matrix.service }} tags: ${{ steps.docker_meta.outputs.tags }} labels: ${{ steps.docker_meta.outputs.labels }} - platforms: linux/amd64 + platforms: linux/amd64,linux/arm64 push: true # Push with pr-### and sha-xxxxxxx tags - name: Build and Push Latest From e96440aa7b8be6e34b88afc32ac4906f74a9120c Mon Sep 17 00:00:00 2001 From: pookie Date: Fri, 23 Feb 2024 12:03:20 -0800 Subject: [PATCH 4/5] adding packages for arm builds --- workers/tesseract-lambda/Dockerfile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/workers/tesseract-lambda/Dockerfile b/workers/tesseract-lambda/Dockerfile index 6aec5cb..1323a70 100644 --- a/workers/tesseract-lambda/Dockerfile +++ b/workers/tesseract-lambda/Dockerfile @@ -5,11 +5,15 @@ FROM public.ecr.aws/lambda/nodejs:16 RUN rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm \ && yum -y update \ - && yum -y install tesseract + && yum -y groupinstall 'Development Tools' \ + && yum -y install tesseract python3 COPY app ${LAMBDA_TASK_ROOT} COPY package.json ${LAMBDA_TASK_ROOT} RUN npm install +RUN yum -y remove python3 binutils \ + && yum -y --setopt=groupremove_leaf_only=1 groupremove 'Development Tools' + CMD ["app.handler"] From 93d8a3c6ddd6fe2c4974621ce621aeef77bd764b Mon Sep 17 00:00:00 2001 From: pookie Date: Fri, 23 Feb 2024 12:06:40 -0800 Subject: [PATCH 5/5] using multi-stage build to support arm images --- workers/tesseract-lambda/Dockerfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/workers/tesseract-lambda/Dockerfile b/workers/tesseract-lambda/Dockerfile index 1323a70..1e96a0c 100644 --- a/workers/tesseract-lambda/Dockerfile +++ b/workers/tesseract-lambda/Dockerfile @@ -13,7 +13,8 @@ COPY package.json ${LAMBDA_TASK_ROOT} RUN npm install -RUN yum -y remove python3 binutils \ - && yum -y --setopt=groupremove_leaf_only=1 groupremove 'Development Tools' +FROM public.ecr.aws/lambda/nodejs:16 + +COPY --from=0 ${LAMBDA_TASK_ROOT} ${LAMBDA_TASK_ROOT} CMD ["app.handler"]