Files
Nuno do Carmo 2b6bf6ca9a Changed HUGO_VERSION variable to ARG instead of ENV (#901)
this is a small change, however it will allow the creation of images based on a specific GoHugo version if needed.
The build command should be something like:
`docker build --build-arg HUGO_VERSION=0.51 -t repo/image-name .`

I tested the build as written above and it worked fine, but please feel free to test it further.
2018-11-16 09:59:06 -05:00

22 lines
534 B
Docker

FROM alpine:3.8 as builder
ARG HUGO_VERSION=0.50
ENV HUGO_BINARY=hugo_${HUGO_VERSION}_Linux-64bit.tar.gz
ADD https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/${HUGO_BINARY} /tmp
RUN tar -xf /tmp/${HUGO_BINARY} -C /tmp
FROM alpine:3.8
COPY --from=builder /tmp/hugo /usr/local/bin/hugo
RUN apk upgrade --update \
&& apk add --no-cache git asciidoctor libc6-compat libstdc++ ca-certificates
WORKDIR /src
CMD ["hugo", "server", "-s", "/src", "-b", "http://localhost:1313", "--bind", "0.0.0.0"]
EXPOSE 1313