-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
allow to use gcp-get-secret as stand-alone image
- Loading branch information
1 parent
eb9e0f7
commit 72adcba
Showing
2 changed files
with
21 additions
and
6 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,9 +1,16 @@ | ||
FROM golang:1.16 | ||
FROM alpine:3 as ca | ||
RUN apk add --no-cache ca-certificates | ||
|
||
|
||
FROM golang:1.16 as go | ||
|
||
WORKDIR /gcp-get-secret | ||
ADD . /gcp-get-secret | ||
RUN go mod download | ||
RUN CGO_ENABLED=0 GOOS=linux go build -o gcp-get-secret -ldflags '-extldflags "-static"' . | ||
|
||
FROM scratch | ||
COPY --from=0 /gcp-get-secret/gcp-get-secret / | ||
COPY --from=ca /etc/ssl/certs/ /etc/ssl/certs/ | ||
COPY --from=go /gcp-get-secret/gcp-get-secret / | ||
|
||
ENTRYPOINT [ "/gcp-get-secret" ] |
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