-
Notifications
You must be signed in to change notification settings - Fork 8
/
Dockerfile-build
38 lines (30 loc) · 1.02 KB
/
Dockerfile-build
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
35
36
37
38
# This file was cloned from https://github.com/mengzyou/docker-hugo/blob/main/Dockerfile
# It was moved to this repo to protect against upstream version upgrades
# Dockerfile to build hugo sites
# It reads the local directory as source files
# It outputs to the /docs directory
#
# Usage:
# cd <sqlitebrowser-website-directory>
# Build container with: docker build -f Dockerfile-build -t hugo-build .
# Build Hugo site with: docker run --rm -v $(pwd):/home/hugo/app hugo-build
# Base image
FROM alpine:latest
ENV VERSION=0.111.3 \
ARCH=linux-amd64
RUN apk add --no-cache tini \
&& adduser -D hugo \
&& mkdir -p /home/hugo/app \
&& chown -R hugo:hugo /home/hugo/app
# Install hugo binary
RUN set -x \
&& cd /tmp/ \
&& wget https://github.com/gohugoio/hugo/releases/download/v${VERSION}/hugo_${VERSION}_${ARCH}.tar.gz \
&& tar zxf hugo_${VERSION}_${ARCH}.tar.gz \
&& mv ./hugo /usr/local/bin/ \
&& rm -rf *
WORKDIR /home/hugo/app
USER hugo
EXPOSE 1313
ENTRYPOINT [ "/sbin/tini", "--" ]
CMD ["hugo", "-v", "-d", "./docs"]