Skip to content

Commit

Permalink
Merge pull request #24 from janaz/fix-docker-size
Browse files Browse the repository at this point in the history
Use build image for compilation to reduce the size of the target image
  • Loading branch information
tigris committed Mar 27, 2020
2 parents 7b7d839 + 6ab0dc9 commit 16db5c8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 9 additions & 1 deletion Dockerfile
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"]
2 changes: 1 addition & 1 deletion Dockerfile.xcompile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.13
FROM golang:1.13@sha256:652c8f8ec2153ce500c7c8e984afd3115c1c58d3a0445643858930439d7664e1

RUN go get github.com/mitchellh/gox

Expand Down

0 comments on commit 16db5c8

Please sign in to comment.