diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c259b14..e5d3c9e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -2,9 +2,12 @@ name: Docker Image CI on: push: - branches: [ "main" ] - pull_request: - branches: [ "main" ] + branches: [ "main", "test" ] + # don't trigger if just updating docs + paths-ignore: + - "**.md" + # pull_request: + # branches: [ "main", "test" ] env: REGISTRY: ghcr.io @@ -19,6 +22,12 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v4 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Log in to the Container registry uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 with: @@ -32,10 +41,11 @@ jobs: with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-go - name: Build and push Docker image (go) - uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4 + uses: docker/build-push-action@v5 with: context: ./go push: true + platforms: linux/arm64 tags: ${{ steps.meta-go.outputs.tags }} labels: ${{ steps.meta-go.outputs.labels }} # Python image @@ -45,10 +55,11 @@ jobs: with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-py - name: Build and push Docker image (py) - uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4 + uses: docker/build-push-action@v5 with: context: ./python push: true + platforms: linux/arm64 tags: ${{ steps.meta-py.outputs.tags }} labels: ${{ steps.meta-py.outputs.labels }} # Javascript image @@ -58,10 +69,11 @@ jobs: with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-js - name: Build and push Docker image (js) - uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4 + uses: docker/build-push-action@v5 with: context: ./javascript push: true + platforms: linux/arm64 tags: ${{ steps.meta-js.outputs.tags }} labels: ${{ steps.meta-js.outputs.labels }} diff --git a/go/Dockerfile b/go/Dockerfile index 9496cb8..dd61bd5 100644 --- a/go/Dockerfile +++ b/go/Dockerfile @@ -2,7 +2,7 @@ FROM golang:1.22-alpine as builder RUN mkdir /app WORKDIR /app COPY ./src /app -RUN CGO_ENABLED=0 GOOS=linux go build -a -tags netgo -o ./service +RUN CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -a -tags netgo -o ./service FROM builder as dev # Add curl for healthchecks @@ -10,7 +10,7 @@ RUN apk add curl RUN go get github.com/githubnemo/CompileDaemon RUN go install github.com/githubnemo/CompileDaemon -FROM alpine:latest +FROM arm64v8/alpine:latest # Add curl for healthchecks RUN apk add curl # Copy the binary from the builder diff --git a/javascript/Dockerfile b/javascript/Dockerfile index 0be6db7..6ff042f 100644 --- a/javascript/Dockerfile +++ b/javascript/Dockerfile @@ -1,4 +1,4 @@ -FROM node:20-slim +FROM arm64v8/node:20-slim WORKDIR /app diff --git a/python/Dockerfile b/python/Dockerfile index efba978..9dd2768 100644 --- a/python/Dockerfile +++ b/python/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.12-slim +FROM arm64v8/python:3.12-slim RUN mkdir /app WORKDIR /app