Skip to content

Commit d8bfa18

Browse files
authored
Merge pull request #216 from databacker/multiarch
multiarch build, both Makefile and GHActions
2 parents b93e1fc + a6bbe54 commit d8bfa18

File tree

4 files changed

+18
-9
lines changed

4 files changed

+18
-9
lines changed

.github/workflows/ci.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,17 @@ jobs:
2323
runs-on: ubuntu-latest
2424
steps:
2525
- name: checkout
26-
uses: actions/checkout@v2
26+
uses: actions/checkout@v3
27+
- name: Set up QEMU
28+
uses: docker/setup-qemu-action@v2
2729
- name: Set up Docker Buildx
2830
uses: docker/setup-buildx-action@v1
2931
- name: Build and push
3032
id: docker_build
3133
uses: docker/build-push-action@v2
3234
with:
3335
push: false
36+
platforms: linux/amd64,linux/arm64
3437
tags: |
3538
${{env.IMAGE_NAME}}:${{github.sha}}
3639
- name: test

.github/workflows/deploy.yaml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,13 @@ jobs:
2121
runs-on: ubuntu-latest
2222
steps:
2323
- name: checkout
24-
uses: actions/checkout@v2
24+
uses: actions/checkout@v3
25+
- name: Set up QEMU
26+
uses: docker/setup-qemu-action@v2
2527
- name: Set up Docker Buildx
26-
uses: docker/setup-buildx-action@v1
28+
uses: docker/setup-buildx-action@v2
2729
- name: Login to DockerHub
28-
uses: docker/login-action@v1
30+
uses: docker/login-action@v2
2931
with:
3032
username: ${{ secrets.DOCKER_USERNAME }}
3133
password: ${{ secrets.DOCKER_PASSWORD }}
@@ -34,6 +36,7 @@ jobs:
3436
uses: docker/build-push-action@v2
3537
with:
3638
push: true
39+
platforms: linux/amd64,linux/arm64
3740
tags: |
3841
${{env.IMAGE_NAME}}:${{github.sha}}
3942
${{env.IMAGE_NAME}}:master

.github/workflows/release.yaml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,13 @@ jobs:
2121
runs-on: ubuntu-latest
2222
steps:
2323
- name: Checkout
24-
uses: actions/checkout@v2
24+
uses: actions/checkout@v3
25+
- name: Set up QEMU
26+
uses: docker/setup-qemu-action@v2
2527
- name: Set up Docker Buildx
26-
uses: docker/setup-buildx-action@v1
28+
uses: docker/setup-buildx-action@v2
2729
- name: Login to DockerHub
28-
uses: docker/login-action@v1
30+
uses: docker/login-action@v2
2931
with:
3032
username: ${{ secrets.DOCKER_USERNAME }}
3133
password: ${{ secrets.DOCKER_PASSWORD }}
@@ -34,6 +36,7 @@ jobs:
3436
uses: docker/build-push-action@v2
3537
with:
3638
push: true
39+
platforms: linux/amd64,linux/arm64
3740
tags: |
3841
${{env.IMAGE_NAME}}:${{ github.ref_name }}
3942
${{env.IMAGE_NAME}}:latest

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ TAG ?= $(shell git log -n 1 --pretty=format:"%H")
44
IMAGE ?= databack/mysql-backup
55
BUILDIMAGE ?= $(IMAGE):build
66
TARGET ?= $(IMAGE):$(TAG)
7-
7+
ARCH ?= linux/amd64,linux/arm64
88

99
build:
10-
docker build -t $(BUILDIMAGE) .
10+
docker buildx build -t $(BUILDIMAGE) --platform $(ARCH) .
1111

1212
push: build
1313
docker tag $(BUILDIMAGE) $(TARGET)

0 commit comments

Comments
 (0)