-
Notifications
You must be signed in to change notification settings - Fork 411
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch docker images to distroless/static and go 1.20.4
- Loading branch information
Showing
3 changed files
with
26 additions
and
61 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,17 +1,18 @@ | ||
FROM golang:1.17-alpine3.15 AS binary | ||
RUN apk --no-cache --update add openssl git | ||
FROM golang:1.20.4 AS binary | ||
|
||
WORKDIR /go/src/github.com/jwilder/dockerize | ||
COPY *.go go.* /go/src/github.com/jwilder/dockerize/ | ||
|
||
ENV GO111MODULE=on | ||
RUN go mod tidy | ||
RUN go install | ||
|
||
FROM alpine:3.15 | ||
RUN CGO_ENABLED=0 GOOS=linux GO111MODULE=on go build -a -o /go/bin/dockerize . | ||
|
||
FROM gcr.io/distroless/static:nonroot | ||
LABEL MAINTAINER="Jason Wilder <mail@jasonwilder.com>" | ||
|
||
COPY --from=binary /go/bin/dockerize /usr/local/bin | ||
USER nonroot:nonroot | ||
COPY --from=binary /go/bin/dockerize /bin/dockerize | ||
|
||
ENTRYPOINT ["dockerize"] | ||
ENTRYPOINT ["/bin/dockerize"] | ||
CMD ["--help"] |
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
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