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