-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
4 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,13 @@ | ||
FROM golang:1.21-bullseye as builder | ||
RUN apt-get update && apt-get install -y upx | ||
|
||
WORKDIR /workspace | ||
COPY . /workspace | ||
RUN go mod download | ||
|
||
RUN GOOS=linux GOARCH=amd64 go build -a -o haproxy-operator main.go && \ | ||
upx -q haproxy-operator | ||
|
||
|
||
FROM gcr.io/distroless/static:nonroot | ||
RUN go mod download | ||
RUN GOOS=linux GOARCH=amd64 go build -a -o haproxy-operator main.go | ||
|
||
FROM scratch | ||
WORKDIR /opt/go/ | ||
COPY --from=builder /workspace/haproxy-operator /opt/go/haproxy-operator | ||
|
||
USER 1001:1001 | ||
|
||
ENTRYPOINT ["/opt/go/haproxy-operator"] | ||
ENTRYPOINT ["/opt/go/haproxy-operator"] |