From f7eccf9c4e19f8f63cc3613235cf5ce9ec03ad4c Mon Sep 17 00:00:00 2001 From: Philipp Wundrack Date: Fri, 27 May 2022 14:52:28 +0200 Subject: [PATCH 1/5] fix dockerfile for arm64 architecture --- Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Dockerfile b/Dockerfile index a0522b4..c1a61a2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,6 +2,9 @@ FROM node:12.7-alpine AS build WORKDIR /usr/src/app COPY package.json package-lock.json ./ +RUN apk add --no-cache python2 +RUN apk add --no-cache make +RUN apk add --no-cache g++ RUN npm install COPY . . RUN npm run build From e719e7492bd8aedcfef88f472de55ad2f47d3b83 Mon Sep 17 00:00:00 2001 From: Philipp Wundrack Date: Fri, 27 May 2022 14:53:04 +0200 Subject: [PATCH 2/5] add arm64 to image build workflow --- .github/workflows/dockerhub.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/dockerhub.yml b/.github/workflows/dockerhub.yml index 6572081..1000b89 100644 --- a/.github/workflows/dockerhub.yml +++ b/.github/workflows/dockerhub.yml @@ -31,5 +31,6 @@ jobs: uses: docker/build-push-action@v2 with: context: . + platforms: linux/amd64,linux/arm64 push: true tags: opentosca/bowie:latest From 015cf894e4583381088a1df0cf5ea114535de282 Mon Sep 17 00:00:00 2001 From: Philipp Wundrack Date: Thu, 23 Mar 2023 14:02:02 +0100 Subject: [PATCH 3/5] replace docker hub with the GitHub registry --- .github/workflows/dockerhub.yml | 38 ++++++++++++++++++++------------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/.github/workflows/dockerhub.yml b/.github/workflows/dockerhub.yml index 1000b89..b59db6f 100644 --- a/.github/workflows/dockerhub.yml +++ b/.github/workflows/dockerhub.yml @@ -1,36 +1,44 @@ -# This workflow will build the Container and push a corresponding Docker image to Dockerhub -name: Push docker image to Dockerhub +# This workflow will build the Container and push a corresponding Docker image to the GitHub registry +name: Push docker image to the GitHub registry on: push: branches: propUi tags: - "v*.*.*" + workflow_dispatch: + +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} jobs: multi: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Set up QEMU - uses: docker/setup-qemu-action@v1 - - name: Set output - id: vars - run: echo ::set-output name=tag::${GITHUB_REF#refs/*/} + uses: docker/setup-qemu-action@v2 + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v4 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 - - name: Login to DockerHub - uses: docker/login-action@v1 + uses: docker/setup-buildx-action@v2 + - name: Login to the GitHub registry + uses: docker/login-action@v2 with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_ACCESS_TOKEN }} - + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push latest Container if: ${{ steps.vars.outputs.tag == 'propUi' }} - uses: docker/build-push-action@v2 + uses: docker/build-push-action@v4 with: context: . platforms: linux/amd64,linux/arm64 push: true - tags: opentosca/bowie:latest + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} From 82985be59ea472519c506f0d0bbd30663b5d5d3b Mon Sep 17 00:00:00 2001 From: Philipp Wundrack Date: Thu, 23 Mar 2023 14:09:45 +0100 Subject: [PATCH 4/5] remove condition for building image --- .github/workflows/dockerhub.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/dockerhub.yml b/.github/workflows/dockerhub.yml index b59db6f..54a0cca 100644 --- a/.github/workflows/dockerhub.yml +++ b/.github/workflows/dockerhub.yml @@ -34,7 +34,6 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push latest Container - if: ${{ steps.vars.outputs.tag == 'propUi' }} uses: docker/build-push-action@v4 with: context: . From d2ccc0d3b30ceee21f8ed45f2124174f9f7746a9 Mon Sep 17 00:00:00 2001 From: Philipp Wundrack Date: Thu, 23 Mar 2023 16:30:06 +0100 Subject: [PATCH 5/5] disable arm64 image build as it hangs in the docker workflow --- .github/workflows/dockerhub.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dockerhub.yml b/.github/workflows/dockerhub.yml index 54a0cca..3a06436 100644 --- a/.github/workflows/dockerhub.yml +++ b/.github/workflows/dockerhub.yml @@ -37,7 +37,7 @@ jobs: uses: docker/build-push-action@v4 with: context: . - platforms: linux/amd64,linux/arm64 + platforms: linux/amd64 #,linux/arm64 push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }}