-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: zufardhiyaulhaq <[email protected]>
- Loading branch information
1 parent
9c9437f
commit e29d6b3
Showing
2 changed files
with
6 additions
and
25 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,36 +1,17 @@ | ||
################# | ||
# Builder image | ||
################# | ||
FROM alpine:3.16 as base | ||
|
||
USER root | ||
|
||
RUN apk --no-cache add ca-certificates \ | ||
&& update-ca-certificates | ||
|
||
RUN addgroup -g 10001 istio-upgrade-consumer && \ | ||
adduser --disabled-password --system --gecos "" --home "/home/istio-upgrade-consumer" --shell "/sbin/nologin" --uid 10001 istio-upgrade-consumer && \ | ||
mkdir -p "/home/istio-upgrade-consumer" && \ | ||
chown istio-upgrade-consumer:0 /home/istio-upgrade-consumer && \ | ||
chmod g=u /home/istio-upgrade-consumer && \ | ||
chmod g=u /etc/passwd | ||
|
||
ENV USER=istio-upgrade-consumer | ||
USER 10001 | ||
WORKDIR /home/istio-upgrade-consumer | ||
|
||
################# | ||
# Builder image | ||
################# | ||
FROM golang:1.22-bullseye AS builder | ||
|
||
WORKDIR /app | ||
COPY . . | ||
RUN make build.binaries | ||
RUN CGO_ENABLED=0 go build main.go | ||
|
||
################# | ||
# Final image | ||
################# | ||
FROM base | ||
FROM gcr.io/distroless/base | ||
|
||
COPY --from=builder /app/main / | ||
|
||
COPY --from=builder /app/bin/istio-upgrade-consumer /usr/local/bin | ||
CMD ["/main"] |
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