Skip to content

Commit

Permalink
Remove upx
Browse files Browse the repository at this point in the history
  • Loading branch information
snorwin committed Dec 29, 2023
1 parent 11a6982 commit b12f7d5
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions Containerfile
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"]

0 comments on commit b12f7d5

Please sign in to comment.