-
-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…mage Feature/gh 92 scratch docker image
- Loading branch information
Showing
5 changed files
with
65 additions
and
1 deletion.
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
FROM golang | ||
|
||
WORKDIR $GOPATH/src/github.com/resgateio/resgate | ||
COPY . . | ||
|
||
RUN go get -d -v | ||
RUN CGO_ENABLED=0 GO111MODULE=off go install -v -ldflags "-s -w" | ||
|
||
EXPOSE 8080 | ||
|
||
ENTRYPOINT ["resgate"] | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
FROM golang:1.12.5-alpine3.9 as builder | ||
|
||
LABEL maintainer="Samuel Jirenius <samuel@jirenius.com>" | ||
|
||
WORKDIR $GOPATH/src/github.com/resgateio/resgate | ||
|
||
RUN apk update && apk add --no-cache git ca-certificates && update-ca-certificates | ||
RUN mkdir /user && \ | ||
echo 'nobody:x:65534:65534:nobody:/:' > /user/passwd && \ | ||
echo 'nobody:x:65534:' > /user/group | ||
|
||
COPY . . | ||
|
||
RUN go get -d -v | ||
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=off go build -v -ldflags "-s -w" -o /resgate | ||
|
||
FROM scratch | ||
|
||
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ | ||
COPY --from=builder /user/group /user/passwd /etc/ | ||
COPY --from=builder /resgate /resgate | ||
|
||
EXPOSE 8080 | ||
|
||
USER nobody:nobody | ||
|
||
ENTRYPOINT ["/resgate"] | ||
CMD ["--config", "config.json"] |
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
FROM golang:1.12.5-alpine3.9 as builder | ||
|
||
LABEL maintainer="Samuel Jirenius <samuel@jirenius.com>" | ||
|
||
WORKDIR $GOPATH/src/github.com/resgateio/resgate | ||
|
||
RUN apk add --update git | ||
|
||
COPY . . | ||
|
||
RUN go get -d -v | ||
RUN GO111MODULE=off go build -v -ldflags "-s -w" -o /resgate | ||
|
||
FROM alpine:3.9 | ||
|
||
RUN apk add --update ca-certificates | ||
|
||
COPY --from=builder /resgate /bin/resgate | ||
|
||
EXPOSE 8080 | ||
|
||
ENTRYPOINT ["/bin/resgate"] | ||
CMD [""] |
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