2018-03-18 20:54:49 +00:00
|
|
|
# GitHub: https://github.com/gohugoio
|
|
|
|
# Twitter: https://twitter.com/gohugoio
|
|
|
|
# Website: https://gohugo.io/
|
2016-01-04 07:27:21 +00:00
|
|
|
|
2019-02-07 01:01:26 +00:00
|
|
|
FROM golang:1.11-stretch AS build
|
2018-03-18 20:54:49 +00:00
|
|
|
|
2017-09-07 13:17:44 +00:00
|
|
|
|
2017-09-07 13:08:56 +00:00
|
|
|
WORKDIR /go/src/github.com/gohugoio/hugo
|
2019-02-07 01:01:26 +00:00
|
|
|
RUN apt-get install \
|
|
|
|
git gcc g++ binutils
|
2018-03-18 20:54:49 +00:00
|
|
|
COPY . /go/src/github.com/gohugoio/hugo/
|
2019-02-07 01:01:26 +00:00
|
|
|
ENV GO111MODULE=on
|
|
|
|
RUN go get -d .
|
|
|
|
|
|
|
|
ARG CGO=0
|
|
|
|
ENV CGO_ENABLED=${CGO}
|
|
|
|
ENV GOOS=linux
|
|
|
|
|
|
|
|
# default non-existent build tag so -tags always has an arg
|
|
|
|
ARG BUILD_TAGS="99notag"
|
|
|
|
RUN go install -ldflags '-w -extldflags "-static"' -tags ${BUILD_TAGS}
|
2018-03-18 20:54:49 +00:00
|
|
|
|
|
|
|
# ---
|
2016-01-04 07:27:21 +00:00
|
|
|
|
2018-03-18 20:54:49 +00:00
|
|
|
FROM scratch
|
|
|
|
COPY --from=build /go/bin/hugo /hugo
|
2019-02-07 01:01:26 +00:00
|
|
|
ARG WORKDIR="/site"
|
|
|
|
WORKDIR ${WORKDIR}
|
|
|
|
VOLUME ${WORKDIR}
|
2017-07-23 18:30:18 +00:00
|
|
|
EXPOSE 1313
|
2018-03-18 20:54:49 +00:00
|
|
|
ENTRYPOINT [ "/hugo" ]
|
2017-06-28 09:35:26 +00:00
|
|
|
CMD [ "--help" ]
|