Skip to content

Commit e77ad28

Browse files
fixed image build
1 parent ab0480e commit e77ad28

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

.github/workflows/docker-publish.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,6 @@ jobs:
1919
contents: read
2020
packages: write
2121
id-token: write
22-
strategy:
23-
matrix:
24-
platform:
25-
- linux/amd64
26-
- linux/arm64
2722

2823
steps:
2924
- name: Checkout repository
@@ -35,6 +30,10 @@ jobs:
3530
with:
3631
cosign-release: "v2.2.4"
3732

33+
# Set up QEMU for multi-arch builds
34+
- name: Set up QEMU
35+
uses: docker/setup-qemu-action@v3
36+
3837
- name: Set up Docker Buildx
3938
uses: docker/setup-buildx-action@v3
4039

@@ -57,6 +56,7 @@ jobs:
5756
uses: docker/build-push-action@v5
5857
with:
5958
context: .
59+
platforms: linux/amd64,linux/arm64
6060
push: ${{ github.event_name != 'pull_request' }}
6161
tags: ${{ steps.meta.outputs.tags }}
6262
labels: ${{ steps.meta.outputs.labels }}

Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@ RUN npm run build
1111
# Stage 2: Build Backend
1212
FROM golang:1.23-alpine AS backend-builder
1313
WORKDIR /app
14+
RUN apk add --no-cache git
1415
COPY go.mod go.sum ./
1516
RUN go mod download
1617
COPY . .
17-
RUN CGO_ENABLED=0 GOOS=linux go build -o server cmd/main.go
18+
ARG TARGETARCH
19+
RUN CGO_ENABLED=0 GOOS=linux GOARCH=$TARGETARCH go build -o server cmd/main.go
1820

1921
# Stage 3: Final Image
2022
FROM alpine:latest

0 commit comments

Comments
 (0)