Skip to content

Commit 1f36313

Browse files
authored
Merge pull request #707 from GaikwadPratik/multi-arch-image
refactor: add support for multi-arch images
2 parents c6e3d05 + 373f83d commit 1f36313

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

.github/workflows/docker-image.yml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,22 @@ jobs:
1111
steps:
1212
- uses: actions/checkout@v3
1313

14+
- name: Set up QEMU
15+
uses: docker/setup-qemu-action@v3
16+
17+
- name: Set up Docker Buildx
18+
uses: docker/setup-buildx-action@v3
19+
1420
- name: Login to GitHub Container Registry
1521
uses: docker/login-action@v1
1622
with:
1723
registry: ghcr.io
1824
username: ${{ github.actor }}
1925
password: ${{ secrets.GITHUB_TOKEN }}
2026

21-
- name : Build and push DVWA image
27+
- name : Build and push multi-arch DVWA image
2228
run: |
29+
2330
IMAGE_ID=ghcr.io/${{ github.repository_owner }}/dvwa
2431
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
2532
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
@@ -29,8 +36,9 @@ jobs:
2936
echo IMAGE_ID=$IMAGE_ID
3037
echo VERSION=$VERSION
3138
echo COMMIT=$COMMIT
32-
docker image build --tag dvwa .
33-
docker image tag dvwa $IMAGE_ID:$VERSION
34-
docker image tag dvwa $IMAGE_ID:$COMMIT
35-
docker image push $IMAGE_ID:$VERSION
36-
docker image push $IMAGE_ID:$COMMIT
39+
40+
docker buildx build --platform linux/amd64,linux/arm64 \
41+
--tag $IMAGE_ID:$VERSION \
42+
--tag $IMAGE_ID:$COMMIT \
43+
--push .
44+

0 commit comments

Comments
 (0)