diff options
author | Anthony Fok <[email protected]> | 2017-07-26 03:22:39 -0600 |
---|---|---|
committer | Anthony Fok <[email protected]> | 2017-07-26 03:22:39 -0600 |
commit | 9ed48c1c9ae4cd9390f5ef88c8b2b6624e9e247d (patch) | |
tree | 6935c4bc99d5af09861d243f3cc2e6b733cce02b /Dockerfile | |
parent | bfe0bfbbd1a59ddadb72a6b07fecce71716088ec (diff) | |
download | hugo-9ed48c1c9ae4cd9390f5ef88c8b2b6624e9e247d.tar.gz hugo-9ed48c1c9ae4cd9390f5ef88c8b2b6624e9e247d.zip |
Dockerfile: Run go install with -ldflags '-s -w'
This reduce the Docker image size from 27 MB to 20.5 MB.
Diffstat (limited to 'Dockerfile')
-rw-r--r-- | Dockerfile | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Dockerfile b/Dockerfile index 4d6ca2db6..f8ec73a86 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 |