-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24 from janaz/fix-docker-size
Use build image for compilation to reduce the size of the target image
- Loading branch information
Showing
2 changed files
with
10 additions
and
2 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,7 +1,15 @@ | ||
FROM golang:1.13-alpine | ||
FROM golang:1.13-alpine@sha256:7d45a6fc9cde63c3bf41651736996fe94a8347e726fe581926fd8c26e244e3b2 as build | ||
|
||
WORKDIR /go/src/github.com/realestate-com-au/shush | ||
COPY . /go/src/github.com/realestate-com-au/shush | ||
RUN go install | ||
|
||
FROM alpine:3.11@sha256:b276d875eeed9c7d3f1cfa7edb06b22ed22b14219a7d67c52c56612330348239 | ||
|
||
RUN mkdir -p /go/bin | ||
|
||
USER nobody | ||
ENV PATH /go/bin:$PATH | ||
COPY --from=build /go/bin/shush /go/bin/shush | ||
|
||
ENTRYPOINT ["/go/bin/shush"] |
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