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