Skip to content

Commit

Permalink
Multi-architecture image build
Browse files Browse the repository at this point in the history
  • Loading branch information
rnorth committed Dec 23, 2020
1 parent d68af4e commit f3d98bf
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/build-docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Build multi-arch Docker Image

on:
release:
types: [published]
push:
branches: [master]
pull_request:

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Login to Docker Hub
# Only if we need to push an image
if: ${{ github.event_name == 'release' && github.event.action == 'published' }}
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

# Setup for buildx
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1

# Debugging information
- name: Docker info
run: docker info
- name: Buildx inspect
run: docker buildx inspect

# Build and (optionally) push the image
- name: Build image
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm/v7,linux/arm64,linux/ppc64le,linux/s390x
# Only push if we are publishing a release
push: ${{ github.event_name == 'release' && github.event.action == 'published' }}
# Use a 'temp' tag, that won't be pushed, for non-release builds
tags: testcontainers/ryuk:${{ github.event.release.tag_name || 'temp' }}

0 comments on commit f3d98bf

Please sign in to comment.