2017-07-26 06:51:27 +00:00
|
|
|
FROM alpine:3.6
|
2016-01-04 07:27:21 +00:00
|
|
|
|
|
|
|
ENV GOPATH /go
|
2017-07-26 06:51:27 +00:00
|
|
|
ENV PATH $GOPATH/bin:$PATH
|
2016-01-04 07:27:21 +00:00
|
|
|
|
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-07-26 06:51:27 +00:00
|
|
|
dumb-init && \
|
|
|
|
apk add --no-cache --virtual .build-deps \
|
|
|
|
gcc \
|
|
|
|
musl-dev \
|
|
|
|
go \
|
2017-07-23 18:30:18 +00:00
|
|
|
git && \
|
2017-07-26 06:51:27 +00:00
|
|
|
mkdir -p \
|
|
|
|
${GOPATH}/bin \
|
|
|
|
${GOPATH}/pkg \
|
|
|
|
${GOPATH}/src && \
|
2017-06-28 09:35:26 +00:00
|
|
|
go get github.com/kardianos/govendor && \
|
|
|
|
govendor get github.com/gohugoio/hugo && \
|
|
|
|
cd $GOPATH/src/github.com/gohugoio/hugo && \
|
2017-07-23 18:30:18 +00:00
|
|
|
go install && \
|
|
|
|
cd $GOPATH && \
|
|
|
|
rm -rf pkg src .cache bin/govendor && \
|
2017-07-26 06:51:27 +00:00
|
|
|
apk del .build-deps
|
2016-01-04 07:27:21 +00:00
|
|
|
|
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" ]
|