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-10-09 15:27:08 +00:00
|
|
|
FROM golang:1.13-alpine AS build
|
2018-03-18 20:54:49 +00:00
|
|
|
|
2019-10-09 15:27:08 +00:00
|
|
|
# Optionally set HUGO_BUILD_TAGS to "extended" when building like so:
|
|
|
|
# docker build --build-arg HUGO_BUILD_TAGS=extended .
|
|
|
|
ARG HUGO_BUILD_TAGS
|
|
|
|
|
|
|
|
ARG CGO=1
|
|
|
|
ENV CGO_ENABLED=${CGO}
|
|
|
|
ENV GOOS=linux
|
|
|
|
ENV GO111MODULE=on
|
2017-09-07 13:17:44 +00:00
|
|
|
|
2017-09-07 13:08:56 +00:00
|
|
|
WORKDIR /go/src/github.com/gohugoio/hugo
|
2019-10-09 15:27:08 +00:00
|
|
|
|
2018-03-18 20:54:49 +00:00
|
|
|
COPY . /go/src/github.com/gohugoio/hugo/
|
2019-02-07 01:01:26 +00:00
|
|
|
|
2019-10-09 15:27:08 +00:00
|
|
|
# gcc/g++ are required to build SASS libraries for extended version
|
|
|
|
RUN apk update && \
|
|
|
|
apk add --no-cache gcc g++ musl-dev && \
|
|
|
|
go get github.com/magefile/mage
|
2019-02-07 01:01:26 +00:00
|
|
|
|
2019-10-09 15:27:08 +00:00
|
|
|
RUN mage hugo && mage install
|
2018-03-18 20:54:49 +00:00
|
|
|
|
|
|
|
# ---
|
2016-01-04 07:27:21 +00:00
|
|
|
|
2019-12-30 11:18:15 +00:00
|
|
|
FROM alpine:3.11
|
2019-10-09 15:27:08 +00:00
|
|
|
|
|
|
|
COPY --from=build /go/bin/hugo /usr/bin/hugo
|
|
|
|
|
|
|
|
# libc6-compat & libstdc++ are required for extended SASS libraries
|
|
|
|
# ca-certificates are required to fetch outside resources (like Twitter oEmbeds)
|
|
|
|
RUN apk update && \
|
|
|
|
apk add --no-cache ca-certificates libc6-compat libstdc++
|
|
|
|
|
|
|
|
VOLUME /site
|
|
|
|
WORKDIR /site
|
|
|
|
|
|
|
|
# Expose port for live server
|
|
|
|
EXPOSE 1313
|
|
|
|
|
|
|
|
ENTRYPOINT ["hugo"]
|
|
|
|
CMD ["--help"]
|