Skip to content

Commit

Permalink
Use multi-stage build
Browse files Browse the repository at this point in the history
Should shrink image size a lot.
  • Loading branch information
jhaals committed Aug 31, 2017
1 parent 869756f commit e6d8f0b
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
FROM golang:onbuild
FROM golang:alpine as app
RUN apk --no-cache add ca-certificates git
RUN mkdir -p /go/src/app
WORKDIR /go/src/app
COPY . /go/src/app
RUN go-wrapper download && go-wrapper install

FROM alpine:latest
RUN apk --no-cache add ca-certificates
WORKDIR /root/
COPY --from=app /go/src/app/public /root/public
COPY --from=app /go/bin/app .
EXPOSE 1337
CMD ["./app"]

0 comments on commit e6d8f0b

Please sign in to comment.