Skip to content

Commit

Permalink
Dockerfile: Run go install with -ldflags '-s -w'
Browse files Browse the repository at this point in the history
This reduce the Docker image size from 27 MB to 20.5 MB.
  • Loading branch information
anthonyfok committed Jul 26, 2017
1 parent bfe0bfb commit 9ed48c1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ RUN \
go get github.com/kardianos/govendor && \
govendor get github.com/gohugoio/hugo && \
cd $GOPATH/src/github.com/gohugoio/hugo && \
go install && \
rm -f $GOPATH/bin/hugo && \
go install -ldflags '-s -w' && \
cd $GOPATH && \
rm -rf pkg src .cache bin/govendor && \
apk del .build-deps
Expand Down

0 comments on commit 9ed48c1

Please sign in to comment.