Skip to content

Commit

Permalink
Add GHA build & publish (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
jerrinot authored Jun 10, 2022
1 parent c28f07b commit 642533f
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 1 deletion.
50 changes: 50 additions & 0 deletions .github/workflows/build-docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
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
with:
image: tonistiigi/binfmt:qemu-v6.0.0-12
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
with:
version: v0.6.1

# 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/sshd:${{ github.event.release.tag_name || 'temp' }}
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
FROM alpine:3.5
FROM alpine:3.16.0
RUN apk add --no-cache openssh && ssh-keygen -A && echo 'root:root' | chpasswd

0 comments on commit 642533f

Please sign in to comment.