2017-09-07 13:08:56 +00:00
|
|
|
FROM golang:1.9.0-alpine3.6 AS build
|
2016-01-04 07:27:21 +00:00
|
|
|
|
2017-09-07 13:08:56 +00:00
|
|
|
RUN apk add --no-cache --virtual git musl-dev
|
|
|
|
RUN go get github.com/kardianos/govendor
|
2017-09-07 13:17:44 +00:00
|
|
|
|
|
|
|
ADD vendor/vendor.json /go/src/github.com/gohugoio/hugo/vendor/vendor.json
|
2017-09-07 13:08:56 +00:00
|
|
|
WORKDIR /go/src/github.com/gohugoio/hugo
|
2017-09-07 13:17:44 +00:00
|
|
|
RUN govendor sync
|
|
|
|
ADD . /go/src/github.com/gohugoio/hugo/
|
2017-09-07 13:08:56 +00:00
|
|
|
RUN go install -ldflags '-s -w'
|
2016-01-04 07:27:21 +00:00
|
|
|
|
2017-09-07 13:08:56 +00:00
|
|
|
FROM alpine:3.6
|
2017-06-28 09:35:26 +00:00
|
|
|
RUN \
|
|
|
|
adduser -h /site -s /sbin/nologin -u 1000 -D hugo && \
|
2017-07-23 18:30:18 +00:00
|
|
|
apk add --no-cache \
|
2017-09-07 13:08:56 +00:00
|
|
|
dumb-init
|
|
|
|
COPY --from=build /go/bin/hugo /bin/hugo
|
2017-07-23 18:30:18 +00:00
|
|
|
USER hugo
|
2017-06-28 09:35:26 +00:00
|
|
|
WORKDIR /site
|
2017-07-23 18:30:18 +00:00
|
|
|
VOLUME /site
|
|
|
|
EXPOSE 1313
|
2017-06-28 09:35:26 +00:00
|
|
|
|
|
|
|
ENTRYPOINT ["/usr/bin/dumb-init", "--", "hugo"]
|
|
|
|
CMD [ "--help" ]
|