Skip to content

Add Windows and more Linux platforms to the multi-arch image #264

Add Windows and more Linux platforms to the multi-arch image

Add Windows and more Linux platforms to the multi-arch image #264

name: Test & Build multi-arch Docker Image
on:
push:
branches: [ main ]
pull_request:
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
- run: go version
- name: Check out code into the Go module directory
uses: actions/checkout@v4
- name: go-mod verify
run: go mod verify
- name: go-mod tidy
run: go mod tidy
- name: go-build
env:
GOOS: linux
run: go build
- name: go-test
run: go test -v ./...
build-image-linux:
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
- run: go version
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
- name: Docker info
run: docker info
- name: Buildx inspect
run: docker buildx inspect
- name: Build image
uses: docker/build-push-action@v3
with:
context: .
file: linux/Dockerfile
platforms: linux/amd64,linux/arm/v7,linux/arm64,linux/ppc64le,linux/s390x,linux/386,linux/arm/v6
push: false
# Use a 'temp' tag, that won't be pushed for non-release builds
tags: testcontainers/ryuk:${{ github.event.release.tag_name || 'temp' }}-linux
build-image-windows-2019:
runs-on: windows-2022
needs: test
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v3
with:
go-version-file: 'go.mod'
- run: go version
- name: Docker info
run: docker info
- name: Build image
# Use a 'temp' tag, that won't be pushed for non-release builds
run: |
docker build -f windows/Dockerfile --build-arg BASE_IMAGE=mcr.microsoft.com/windows/nanoserver:ltsc2019 -t testcontainers/ryuk:${{ github.event.release.tag_name || 'temp' }}-windows.amd64.ltsc2019 .
build-image-windows-2022:
runs-on: windows-2022
needs: test
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v3
with:
go-version-file: 'go.mod'
- run: go version
- name: Docker info
run: docker info
- name: Build image
# Use a 'temp' tag, that won't be pushed for non-release builds
run: |
docker build -f windows/Dockerfile --build-arg BASE_IMAGE=mcr.microsoft.com/windows/nanoserver:ltsc2022 -t testcontainers/ryuk:${{ github.event.release.tag_name || 'temp' }}-windows.amd64.ltsc2022 .