Skip to content

Commit

Permalink
build(docker-build): optimize the docker build process
Browse files Browse the repository at this point in the history
Signed-off-by: Maik Ellerbrock <opensource@frapsoft.com>
  • Loading branch information
ellerbrock committed Dec 11, 2017
1 parent 4930b0f commit ef25dd3
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,23 @@ FROM golang:1.10-rc-alpine3.7 AS build
ENV CGO_ENABLED=0
ENV GOOS=linux

WORKDIR /go/src/github.com/gohugoio/hugo

RUN \
apk add --no-cache \
git \
musl-dev && \
go get github.com/golang/dep/cmd/dep && \
go get github.com/kardianos/govendor && \
govendor get github.com/gohugoio/hugo && \
cd /go/src/github.com/gohugoio/hugo && \
dep ensure && \
go install -ldflags '-s -w'
go get github.com/golang/dep/cmd/dep

COPY Gopkg.lock Gopkg.toml /go/src/github.com/gohugoio/hugo/

RUN dep ensure -vendor-only

COPY . /go/src/github.com/gohugoio/hugo/

RUN go install -ldflags '-s -w'

COPY . /go/src/github.com/gohugoio/hugo/

# ---

Expand Down

0 comments on commit ef25dd3

Please sign in to comment.