-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
54 lines (48 loc) · 1.57 KB
/
Dockerfile
File metadata and controls
54 lines (48 loc) · 1.57 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# podmanfile-dockerfile
# ------------------------------------------------------------------------------
# Dockerfile for building and running a Hugo static site using Debian Bookworm.
#
# Base Image:
# - debian:bookworm-slim for a minimal, foss environment.
#
# Arguments:
# - HUGO_VERSION: Version of Hugo to install (default: 0.148.2).
#
# Installed Packages:
# - curl: For downloading Hugo binary.
# - make: For running build commands.
# - git: For version control operations.
# - bash: For shell scripting.
# - ca-certificates: For secure HTTPS downloads.
#
# Hugo Installation:
# - Downloads the specified Hugo Extended binary from GitHub.
# - Extracts and installs Hugo to /usr/local/bin.
#
# Working Directory:
# - /site: All site operations are performed here.
#
# Default Command:
# - Runs `make check-env` to verify environment setup.
#
# Usage:
# - Build: docker build -t hugo-site .
# - Run: docker run --rm -v $(pwd):/site hugo-site
# ------------------------------------------------------------------------------
FROM debian:bookworm-slim
ARG HUGO_VERSION=0.148.2
RUN apt-get update && apt-get install -y --no-install-recommends \
curl \
make \
git \
bash \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
RUN curl -L -o /tmp/hugo.tar.gz \
https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-64bit.tar.gz \
&& tar -xzf /tmp/hugo.tar.gz -C /tmp \
&& mv /tmp/hugo /usr/local/bin/hugo \
&& chmod +x /usr/local/bin/hugo \
&& rm /tmp/hugo.tar.gz
WORKDIR /site
CMD ["make", "check-env"]