To maximize the usage of cache, split the govendor get in steps:
- govendor fetch to get the pinned versions of dependencies
- go install to actually build the binary
Doing so allows not to re-download the whole dependencies when changing
lines in hugo repository
The current Dockerfile generates an image of 16.6MB
Signed-off-by: Thibault Jamet <tjamet@users.noreply.github.com>
Docker has recently introduces buikld-stages (as of version 17.05)
Build stages allows to benefit the docker build cache as well as
reducing the size of the resulting image c.f.
https://docs.docker.com/engine/userguide/eng-image/multistage-build/
This change allows to have faster builds when running `docker build`
several times after changing some little code
Signed-off-by: Thibault Jamet <tjamet@users.noreply.github.com>
It's pointless to set `/bin/sh` as entrypoint. `/bin/sh` is already the default command, and on the top of that, setting `/bin/sh` as entrypoint ignores the command.
Hugo has been confirmed which runs on Golang 1.6, as travis uses 1.6
vesion. Dockerfile must be consistend with it so it has to use golang:1.6
as base image than golang:1.5