Skip to content

Commit

Permalink
use args
Browse files Browse the repository at this point in the history
  • Loading branch information
Richard87 committed Jun 18, 2024
1 parent 0001f9e commit 8a97382
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ jobs:
with:
context: .
push: true
platforms: linux/amd64
args: |
TARGETOS:linux
TARGETARCH:amd64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

Expand All @@ -56,6 +58,8 @@ jobs:
with:
context: .
push: true
platforms: linux/arm64
args: |
TARGETOS:linux
TARGETARCH:arm64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,14 @@ RUN go mod download
COPY . .

# Build project
ARG TARGETOS=linux
ARG TARGETARCH=amd64
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 --platform=$TARGETPLATFORM scratch
FROM --platform=$TARGETOS/$TARGETARCH 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 8a97382

Please sign in to comment.