forked from jojomi/docker-hugo
/
Dockerfile
34 lines (27 loc) · 1.25 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# Use Alpine Linux as our base image so that we minimize the overall size our final container, and minimize the surface area of packages that could be out of date.
FROM alpine:3.7@sha256:7b848083f93822dd21b0a2f14a110bd99f6efb4b838d499df6d04a49d0debf8b
LABEL description="Docker container for building static sites with the Hugo static site generator."
LABEL maintainer="Johannes Mitlmeier <dev.jojomi@yahoo.com>"
COPY ./run.sh /run.sh
ENV HUGO_VERSION=0.37.1
ADD https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_${HUGO_VERSION}_Linux-64bit.tar.gz /tmp
#Pick a suitably high GID for sudo group.
RUN addgroup sudo -g 4001
RUN tar -xf /tmp/hugo_${HUGO_VERSION}_Linux-64bit.tar.gz -C /tmp \
&& mkdir -p /usr/local/sbin \
&& mv /tmp/hugo /usr/local/sbin/hugo \
&& rm -rf /tmp/hugo_${HUGO_VERSION}_linux_amd64 \
&& rm -rf /tmp/hugo_${HUGO_VERSION}_Linux-64bit.tar.gz \
&& rm -rf /tmp/LICENSE.md \
&& rm -rf /tmp/README.md
RUN apk add --update git \
&& apk upgrade \
&& apk add --no-cache ca-certificates \
&& apk add sudo
VOLUME /src
VOLUME /output
RUN chmod 0777 /run.sh && ls -lahr / && whoami && cat /run.sh && which sh
WORKDIR /src
COPY ./docker-entrypoint.sh /
ENTRYPOINT ["/docker-entrypoint.sh"]
EXPOSE 1313