Skip to content

Commit

Permalink
Add multiarch output
Browse files Browse the repository at this point in the history
  • Loading branch information
Richard87 committed Jun 18, 2024
1 parent 4e65b7f commit 5b1ea95
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
branches:
- main
workflow_dispatch:
pull_request:


env:
Expand Down Expand Up @@ -46,6 +47,6 @@ jobs:
with:
context: .
push: true
platform: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.22-alpine3.19 as builder
FROM --platform=$BUILDPLATFORM golang:1.22-alpine3.19 as builder

RUN apk update && \
apk add bash jq alpine-sdk sed gawk git ca-certificates curl && \
Expand All @@ -14,12 +14,12 @@ RUN go mod download
COPY . .

# Build project
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags "-s -w" -a -installsuffix cgo -o /radix-oauth-guard
RUN GOOS=$TARGETOS GOARCH=$TARGETARCH CGO_ENABLED=0 go build -ldflags "-s -w" -a -installsuffix cgo -o /radix-oauth-guard

RUN addgroup -S -g 1000 guard
RUN adduser -S -u 1000 -G guard guard

FROM scratch
FROM --platform=$TARGETPLATFORM scratch

COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=builder /etc/passwd /etc/passwd
Expand Down

0 comments on commit 5b1ea95

Please sign in to comment.