From 23a7fd45a3c48b09066e1c49fabef2a0195fc778 Mon Sep 17 00:00:00 2001 From: Dhi Aurrahman Date: Sun, 19 Sep 2021 05:09:00 -0700 Subject: [PATCH 1/2] Tag arm64 images This builds and pushes arm64 flavor for internal images. Signed-off-by: Dhi Aurrahman --- .github/workflows/internal-images.yml | 32 +++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/.github/workflows/internal-images.yml b/.github/workflows/internal-images.yml index af618752..1c8913ba 100644 --- a/.github/workflows/internal-images.yml +++ b/.github/workflows/internal-images.yml @@ -43,10 +43,34 @@ jobs: # - needs repo:status, public_repo, write:packages, delete:packages password: ${{ secrets.GHCR_TOKEN }} - - name: Build and push - run: | # This will only push a single architecture, which is fine as we currently only support amd64 + - name: Setup QEMU + uses: docker/setup-qemu-action@v1 + + - name: Setup Buildx + uses: docker/setup-buildx-action@v1 + + - name: Write Dockerfile for ${{ matrix.target-tag }} + run: | cat > Dockerfile <<'EOF' ${{ matrix.dockerfile }} EOF - docker build -t ghcr.io/tetratelabs/func-e-internal:${{ matrix.target_tag }} . - docker push ghcr.io/tetratelabs/func-e-internal:${{ matrix.target_tag }} + + - name : Build and push + uses: docker/build-push-action@v2 + with: + context: . + platforms: linux/amd64,linux/arm64 # Build and push for amd64 and arm64 architectures. + tags: ghcr.io/${{ github.repository_owner }}/func-e-internal:${{ matrix.target-tag }} + + # We do re-tagging for easier usage when testing using emulation, so we can forcefuly pull + # arm64 image by directly specifiying the tag without the need of supplying + # `--platform linux/arm64`. Using `uses: docker://` only allows to override `args`, but not + # the `--platform` flag. + # Reference: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#example-using-the-github-packages-container-registry. + # Related: https://github.com/actions/virtual-environments/issues/1368. + - name : Re-tag for arm64 only + uses: docker/build-push-action@v2 + with: + context: . + platforms: linux/arm64 # Build and push for arm64 architecture only. + tags: ghcr.io/${{ github.repository_owner }}/func-e-internal:${{ matrix.target-tag }}-arm64 From 0a31ee26b8ef99a75563ae5f34889f835cb99958 Mon Sep 17 00:00:00 2001 From: Dhi Aurrahman Date: Sun, 19 Sep 2021 14:45:31 -0700 Subject: [PATCH 2/2] Remove period Signed-off-by: Dhi Aurrahman --- .github/workflows/internal-images.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/internal-images.yml b/.github/workflows/internal-images.yml index 1c8913ba..9068e8aa 100644 --- a/.github/workflows/internal-images.yml +++ b/.github/workflows/internal-images.yml @@ -66,8 +66,8 @@ jobs: # arm64 image by directly specifiying the tag without the need of supplying # `--platform linux/arm64`. Using `uses: docker://` only allows to override `args`, but not # the `--platform` flag. - # Reference: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#example-using-the-github-packages-container-registry. - # Related: https://github.com/actions/virtual-environments/issues/1368. + # Reference: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#example-using-the-github-packages-container-registry + # Related: https://github.com/actions/virtual-environments/issues/1368 - name : Re-tag for arm64 only uses: docker/build-push-action@v2 with: