2018-03-18 16:54:49 -04:00
|
|
|
# GitHub: https://github.com/gohugoio
|
|
|
|
# Twitter: https://twitter.com/gohugoio
|
|
|
|
# Website: https://gohugo.io/
|
2016-01-04 02:27:21 -05:00
|
|
|
|
2019-02-06 20:01:26 -05:00
|
|
|
FROM golang:1.11-stretch AS build
|
2018-03-18 16:54:49 -04:00
|
|
|
|
2017-09-07 09:17:44 -04:00
|
|
|
|
2017-09-07 09:08:56 -04:00
|
|
|
WORKDIR /go/src/github.com/gohugoio/hugo
|
2019-02-06 20:01:26 -05:00
|
|
|
RUN apt-get install \
|
|
|
|
git gcc g++ binutils
|
2018-03-18 16:54:49 -04:00
|
|
|
COPY . /go/src/github.com/gohugoio/hugo/
|
2019-02-06 20:01:26 -05: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 16:54:49 -04:00
|
|
|
|
|
|
|
# ---
|
2016-01-04 02:27:21 -05:00
|
|
|
|
2019-05-18 01:39:14 -04:00
|
|
|
FROM alpine:3.9
|
|
|
|
RUN apk add --no-cache ca-certificates
|
2018-03-18 16:54:49 -04:00
|
|
|
COPY --from=build /go/bin/hugo /hugo
|
2019-02-06 20:01:26 -05:00
|
|
|
ARG WORKDIR="/site"
|
|
|
|
WORKDIR ${WORKDIR}
|
|
|
|
VOLUME ${WORKDIR}
|
2017-07-23 14:30:18 -04:00
|
|
|
EXPOSE 1313
|
2018-03-18 16:54:49 -04:00
|
|
|
ENTRYPOINT [ "/hugo" ]
|
2017-06-28 05:35:26 -04:00
|
|
|
CMD [ "--help" ]
|