Skip to content

Commit

Permalink
chore: cleanup dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
Richard87 committed Oct 14, 2024
1 parent e16c958 commit 7900807
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
FROM --platform=$BUILDPLATFORM golang:1.23-alpine3.20 AS builder
# Define target arch variables so we can use them while crosscompiling, will be set automatically
ARG TARGETOS
ARG TARGETARCH
ENV CGO_ENABLED=0 \
GOOS=linux \
GOARCH=${TARGETARCH}

WORKDIR /go/src/

# get dependencies
Expand All @@ -12,7 +15,7 @@ RUN go mod download
COPY . .

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

# Final stage, ref https://github.com/GoogleContainerTools/distroless/blob/main/base/README.md for distroless
FROM gcr.io/distroless/static
Expand Down

0 comments on commit 7900807

Please sign in to comment.