Skip to content

Commit f3d98bf

Browse files
committed
Multi-architecture image build
1 parent d68af4e commit f3d98bf

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed
+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Build multi-arch Docker Image
2+
3+
on:
4+
release:
5+
types: [published]
6+
push:
7+
branches: [master]
8+
pull_request:
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v2
15+
- name: Login to Docker Hub
16+
# Only if we need to push an image
17+
if: ${{ github.event_name == 'release' && github.event.action == 'published' }}
18+
uses: docker/login-action@v1
19+
with:
20+
username: ${{ secrets.DOCKERHUB_USERNAME }}
21+
password: ${{ secrets.DOCKERHUB_TOKEN }}
22+
23+
# Setup for buildx
24+
- name: Set up QEMU
25+
uses: docker/setup-qemu-action@v1
26+
- name: Set up Docker Buildx
27+
id: buildx
28+
uses: docker/setup-buildx-action@v1
29+
30+
# Debugging information
31+
- name: Docker info
32+
run: docker info
33+
- name: Buildx inspect
34+
run: docker buildx inspect
35+
36+
# Build and (optionally) push the image
37+
- name: Build image
38+
uses: docker/build-push-action@v2
39+
with:
40+
context: .
41+
file: ./Dockerfile
42+
platforms: linux/amd64,linux/arm/v7,linux/arm64,linux/ppc64le,linux/s390x
43+
# Only push if we are publishing a release
44+
push: ${{ github.event_name == 'release' && github.event.action == 'published' }}
45+
# Use a 'temp' tag, that won't be pushed, for non-release builds
46+
tags: testcontainers/ryuk:${{ github.event.release.tag_name || 'temp' }}

0 commit comments

Comments
 (0)