Skip to content
This repository has been archived by the owner on Jun 13, 2023. It is now read-only.

Arm64 amd64 images #52

Closed
wants to merge 12 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/action_templates/build-and-push/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ runs:
echo "${{ inputs.docker-auth-token }}" | docker login --username awiciroh --password-stdin
- name: Build and tag Docker image
shell: bash
run: docker build -t awiciroh/ciroh-ngen-image:${{ inputs.github-sha }} -t awiciroh/ciroh-ngen-image-${{ inputs.image-platform }}:latest docker/.
run: docker build -t awiciroh/ciroh-ngen-image:${{ inputs.github-sha }} -t awiciroh/ciroh-ngen-image:latest-${{ inputs.image-platform }} docker/.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this build step is where you want to use QEMU and then provide the --platform flag to the build so it can build either one...

- name: Push Docker image
shell: bash
run: |
docker push awiciroh/ciroh-ngen-image-${{ inputs.image-platform }}:${{ inputs.github-sha }}
docker push awiciroh/ciroh-ngen-image-${{ inputs.image-platform }}:latest
docker push awiciroh/ciroh-ngen-image:${{ inputs.github-sha }}
docker push awiciroh/ciroh-ngen-image:latest-${{ inputs.image-platform }}
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,16 @@ on:
- docker/**
jobs:
build-and-push:
runs-on: macos-latest
runs-on: ubuntu-latest
steps:
- name: deploy
uses: actions/checkout@v2
- name: Set up QEMU
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think buildx is building an actual arm image. Since the build-and-push action runs on ubuntu (amd64), just having QEMU ready isn't enough, buildx has to know to build for that platform and work with QEMU. What is actually happening here is buildx is building for the native platform (amd64) and adding the arm platfrom tag.

uses: docker/setup-qemu-action@v2
with:
platforms: 'arm64,arm'
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build and push ARM Docker image for NGEN
uses: ./.github/action_templates/build-and-push
with:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and Push Docker image to Docker Hub
name: Build and Push x86 Docker image to Docker Hub
on:
push:
branches: [ main ]
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/docker_image_manual_build_arm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Manual Build and Push ARM Docker image to Docker Hub
on:
workflow_dispatch:
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: deploy
uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: 'arm64,arm'
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build and push Docker image
uses: ./.github/action_templates/build-and-push
with:
docker-auth-token: ${{ secrets.DOCKER_AUTH_TOKEN }}
github-sha: ${{ github.sha }}
image-platform: "arm"
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Manual Build and Push Docker image to Docker Hub
name: Manual Build and Push x86 Docker image to Docker Hub
on:
workflow_dispatch:
jobs:
Expand All @@ -12,10 +12,4 @@ jobs:
with:
docker-auth-token: ${{ secrets.DOCKER_AUTH_TOKEN }}
github-sha: ${{ github.sha }}
image-platform: "x86"
- name: Build and push Docker image for arm
uses: ./.github/action_templates/build-and-push
with:
docker-auth-token: ${{ secrets.DOCKER_AUTH_TOKEN }}
github-sha: ${{ github.sha }}
image-platform: "arm"
image-platform: "x86"