Skip to content

Commit

Permalink
Merge pull request #1 from dominickp/test
Browse files Browse the repository at this point in the history
Switch to ARM64
  • Loading branch information
dominickp authored Mar 28, 2024
2 parents f501eb9 + 6de3fb3 commit 47c50c5
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 10 deletions.
24 changes: 18 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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 }}

4 changes: 2 additions & 2 deletions go/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ 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
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
Expand Down
2 changes: 1 addition & 1 deletion javascript/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:20-slim
FROM arm64v8/node:20-slim

WORKDIR /app

Expand Down
2 changes: 1 addition & 1 deletion python/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.12-slim
FROM arm64v8/python:3.12-slim

RUN mkdir /app
WORKDIR /app
Expand Down

0 comments on commit 47c50c5

Please sign in to comment.