1
mirror of https://github.com/jakejarvis/hugo-docker.git synced 2025-07-02 01:06:41 -04:00

Compare commits

...

144 Commits

Author SHA1 Message Date
f40b055b15 Update actions/checkout digest to 11bd719 2024-10-23 16:40:39 +00:00
40ca2c3269 Update dependency jgm/pandoc to v3.1.13 2024-04-07 20:24:51 +00:00
9733fc0fa6 Update dependency gohugoio/hugo to v0.124.1 2024-03-20 20:32:33 +00:00
f4114734b1 Update dependency gohugoio/hugo to v0.124.0 2024-03-16 18:07:16 +00:00
fee04015be Update dependency gohugoio/hugo to v0.123.8 2024-03-07 18:18:06 +00:00
f824746b8c Update dependency gohugoio/hugo to v0.123.7 2024-03-01 22:26:12 +00:00
f9610724d5 Update dependency gohugoio/hugo to v0.123.6 2024-02-28 22:52:20 +00:00
fdd2072620 Update dependency gohugoio/hugo to v0.123.4 2024-02-26 22:28:22 +00:00
165a3ca3f7 Update dependency gohugoio/hugo to v0.123.3 2024-02-23 22:55:03 +00:00
a2b583f385 Update dependency gohugoio/hugo to v0.123.2 2024-02-22 23:03:12 +00:00
33c0ae7566 Update dependency gohugoio/hugo to v0.123.1 2024-02-21 12:13:18 +00:00
061c644f39 Update dependency gohugoio/hugo to v0.123.0 2024-02-20 00:28:33 +00:00
748017bd04 Update golang Docker tag to v1.22 2024-02-16 00:26:18 +00:00
9474a6a64d Update dependency jgm/pandoc to v3.1.12 2024-02-15 22:51:44 +00:00
4d5ec5f93f Update peter-evans/dockerhub-description action to v4 2024-01-25 18:12:28 +00:00
49de69b30e Update actions/cache action to v4 2024-01-17 19:11:51 +00:00
1d30ce8bcb Update dependency jgm/pandoc to v3.1.11 2023-12-16 10:19:55 +00:00
b2ab6f0041 Update dependency jgm/pandoc to v3.1.10 2023-12-13 07:17:49 +00:00
3758f9cad1 Update dependency jgm/pandoc to v3.1.9 2023-10-28 03:19:15 +00:00
7f24c16703 Update actions/checkout digest to b4ffde6 2023-10-19 15:01:46 +00:00
c8d6cbb13a Update actions/checkout digest to 8ade135 2023-09-22 23:00:54 +00:00
16b4f6cdd4 Update docker/setup-qemu-action action to v3 2023-09-12 18:26:44 +00:00
06258ba98b Update docker/setup-buildx-action action to v3 2023-09-12 16:00:43 +00:00
846307e4c8 Update docker/login-action action to v3 2023-09-12 13:38:05 +00:00
974cf9f787 Update docker/build-push-action action to v5 2023-09-12 11:01:01 +00:00
5169e3ddfa Update dependency jgm/pandoc to v3.1.8 2023-09-09 21:02:29 +00:00
65507b8300 Update actions/checkout action to v4 2023-09-04 15:32:54 +00:00
4a14b72e5b Update golang Docker tag to v1.21 2023-09-01 11:36:20 +00:00
8305e01188 Update dependency jgm/pandoc to v3.1.7 2023-09-01 00:24:10 +00:00
81a93ea44d Update dependency jgm/pandoc to v3.1.6 2023-07-21 19:49:13 +00:00
d4dab75ac4 Update dependency jgm/pandoc to v3.1.5 2023-07-07 23:18:29 +00:00
c8c26d1fb7 Update dependency jgm/pandoc to v3.1.4 2023-06-25 03:55:13 +00:00
ff4c4d46af Update dependency jgm/pandoc to v3.1.3 2023-06-07 09:36:50 +00:00
e2ba706deb Hugo v0.113.0 2023-06-06 11:15:42 -04:00
59a94508dc Hugo v0.112.7 2023-06-06 11:15:22 -04:00
421a334f8c Hugo v0.112.6 2023-06-06 11:15:15 -04:00
21d629e15c Hugo v0.112.5 2023-06-06 11:14:48 -04:00
391c858bed Hugo v0.112.4 2023-06-06 11:13:23 -04:00
ba3a3969b7 Update renovate.json 2023-05-25 18:27:56 -04:00
af6f3b8139 Hugo v0.112.3 2023-05-25 16:36:13 -04:00
669722c47a Hugo v0.112.2 2023-05-25 12:12:03 -04:00
e98baa7dc4 Hugo v0.112.1 2023-05-25 10:55:48 -04:00
755a524c55 Hugo v0.112.0 2023-05-25 09:47:31 -04:00
18e51db24a Update alpine Docker tag to v3.18 2023-05-10 05:03:35 +00:00
ebe3e97c81 Update dependency sass/dart-sass-embedded to v1.62.1 2023-04-26 07:49:31 +00:00
22e644d81d Update dependency sass/dart-sass-embedded to v1.62.0 2023-04-12 06:17:40 +00:00
4d1191ce2b Update dependency sass/dart-sass-embedded to v1.60.0 2023-03-24 02:13:04 +00:00
9b9a34e059 automatically build & push on new Hugo releases 2023-03-15 12:31:58 -04:00
3d5a32a41a Configure Renovate (#5)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Jake Jarvis <jake@jarv.is>
2023-03-15 09:59:24 -04:00
bdfadabde1 Hugo v0.111.3 2023-03-12 09:02:25 -04:00
ad2b89ae8e Hugo v0.111.2 2023-03-07 08:13:19 -05:00
ad10482235 Hugo v0.111.1 2023-03-02 10:44:11 -05:00
4a98dad700 Hugo v0.111.0 (and Alpine v3.17) 2023-03-02 10:43:40 -05:00
e91bc2ed98 This commit fixes a failure scenario caused when the UID of the user within the hugo-extended container does not match the UID or GID of the respective user and group ownership assigned to the files and directories in the volume mounted to /src.
The failure occurs when a git operation triggers recently added safe directory checks to alert the user when there is a UID or GID mismatch.  Because the ENTRYPOINT of the hugo-extended container is a call to `hugo`, there is no ability for the end user of the container to tell git to trust the /src directory before hugo is started.

It is possible to override the UID and GID when using the container, but this causes permission errors and does not seem like a user-friendly path forward.

After this change, the hugo-extended container will contain a global git configuration to trust the /src directory.  This may have security implications that have not been considered, but since only the project directory is mounted to /src, this approach seems to respect the intent of git safe directory checks.
2023-03-02 10:36:36 -05:00
048f5d17f2 Hugo v0.110.0 2023-01-17 10:44:12 -05:00
5c457e33fe bump GH actions 2023-01-17 10:44:09 -05:00
0a8ca90615 Hugo v0.109.0 2022-12-23 09:59:58 -05:00
8b514c58d7 Hugo v0.108.0 2022-12-06 13:35:43 -05:00
20f98c58b7 Hugo v0.107.0 2022-11-24 15:31:29 -05:00
a10483b36a Hugo v0.106.0 2022-11-17 13:58:35 -05:00
e5a6870534 Hugo v0.105.0 2022-10-28 09:15:18 -04:00
62b12c0d22 Hugo v0.104.3 2022-10-04 12:07:52 -04:00
df27582975 Hugo v0.104.2 2022-09-29 10:58:16 -04:00
6cc3f39751 Hugo v0.104.1 2022-09-26 20:11:22 -04:00
8540c876dd Hugo v0.104.0 2022-09-23 11:32:05 -04:00
e806604521 Hugo v0.103.1 2022-09-18 14:05:41 -04:00
7fc2ac2b8e Hugo v0.103.0 2022-09-15 15:15:44 -04:00
56a30dab8f build with go 1.19 2022-09-06 14:20:06 -04:00
f49e3b1dcd Hugo v0.102.3 2022-09-01 08:06:03 -04:00
2de4b89509 Hugo v0.102.2 2022-08-31 16:15:55 -04:00
10103bce3b Hugo v0.102.1 2022-08-29 10:50:24 -04:00
fcb292357c Hugo v0.102.0 2022-08-28 16:24:46 -04:00
61fa24ed38 switch from mage to go build so go and alpine can be bumped 2022-07-29 13:44:08 -04:00
250387c4f1 Hugo v0.101.0 2022-06-16 07:25:39 -04:00
6e5386c78a Hugo v0.100.2 2022-06-08 17:54:57 -04:00
86af318435 Hugo v0.100.1 2022-06-01 17:14:47 -04:00
5bbac6174f Hugo v0.100.0 2022-05-31 17:09:32 -04:00
9fc7783e5a Hugo v0.99.1 2022-05-18 09:25:21 -04:00
4f26d81802 Hugo v0.99.0 2022-05-16 08:47:28 -04:00
de42257aa2 Hugo v0.98.0 2022-04-28 12:15:48 -04:00
e10c7362c7 Hugo v0.97.3 2022-04-18 17:24:14 -04:00
5bd125e947 Hugo v0.97.2 2022-04-17 11:48:20 -04:00
92aeed4a00 Hugo v0.97.1 2022-04-16 13:38:23 -04:00
23cd994860 Hugo v0.97.0 2022-04-14 09:16:05 -04:00
5bbdb9ba12 Hugo v0.96.0 2022-03-26 13:36:59 -04:00
b69006cb54 Hugo v0.95.0 (with fixes for Go 1.18) 2022-03-16 21:25:36 -04:00
f0b59209e5 Hugo v0.94.2 2022-03-12 08:58:35 -05:00
061289816b Hugo v0.94.1 2022-03-11 12:04:03 -05:00
e59900daaa Hugo v0.94.0 2022-03-10 09:30:02 -05:00
92748c6c0f Hugo v0.93.3 2022-03-08 10:26:46 -05:00
18a14635c0 Hugo v0.93.2 2022-03-04 09:16:30 -05:00
3cb403f6fa Hugo v0.93.1 2022-03-02 10:38:03 -05:00
70c9d418ec Hugo v0.93.0 2022-02-28 13:18:35 -05:00
4ec3e8be98 Hugo v0.92.2 2022-02-11 20:23:55 -05:00
f1513cf6c7 Hugo v0.92.1 2022-01-27 11:39:10 -05:00
e608453299 Hugo v0.92.0 2022-01-13 13:58:50 -05:00
7a43febe15 Hugo v0.91.2 2021-12-23 14:34:14 -05:00
4898a96b66 Hugo v0.91.1 2021-12-23 13:17:33 -05:00
73e0bf7815 Hugo v0.91.0 2021-12-17 08:38:39 -05:00
d6ca9055b4 Hugo v0.90.1 2021-12-10 13:03:12 -05:00
bca0721d67 Hugo v0.90.0 2021-12-08 10:50:19 -05:00
33bd893ed3 Hugo v0.89.4 2021-11-17 08:57:41 -05:00
d9338044c5 Hugo v0.89.3 2021-11-15 09:27:24 -05:00
cb26219a40 Hugo v0.89.2 2021-11-08 11:05:02 -05:00
f6580ec25c Hugo v0.89.1 2021-11-05 12:28:16 -04:00
6bc21e062a Hugo v0.89.0 2021-11-02 08:56:03 -04:00
04930ae9ae Hugo v0.88.1 2021-09-04 08:09:11 -04:00
eb82474eb8 Hugo v0.88.0, Go v1.17 2021-09-02 08:09:16 -04:00
90b15c893d Hugo v0.87.0 2021-08-03 13:33:51 -04:00
b31b18ac2d bump alpine, pandoc, and sass embedded versions 2021-07-30 10:23:11 -04:00
4df70ef38c Hugo v0.86.1 2021-07-30 08:33:13 -04:00
f75b85512b Hugo v0.86.0 2021-07-21 08:21:54 -04:00
f97154879d Hugo v0.85.0 2021-07-05 08:05:59 -04:00
4f1d3a9c48 Hugo v0.84.4 2021-07-01 09:33:05 -04:00
22ba6e27d0 Hugo v0.84.3 2021-06-29 08:44:34 -04:00
3123853163 Hugo v0.84.2 2021-06-28 08:39:27 -04:00
5d7840092e Hugo v0.84.1 2021-06-24 21:03:20 -04:00
7d20947610 Hugo v0.84.0 2021-06-18 17:57:55 -04:00
a6b5427dca bump pandoc to v2.14
https://github.com/jgm/pandoc/releases/tag/2.14
2021-05-29 10:26:16 -04:00
941079893a Hugo v0.83.1 2021-05-02 11:30:07 -04:00
8a2fe24434 Update README.md
[skip ci]
2021-05-01 10:09:26 -04:00
bdf6d208b4 Hugo v0.83.0 2021-05-01 09:09:40 -04:00
de4ef2242f install dart SASS embedded (on amd64 image only) 2021-05-01 09:09:23 -04:00
a7e4ccee25 Hugo v0.82.1 2021-04-20 09:36:36 -04:00
77fc7a219c clear temp directories and caches in final image 2021-04-03 09:38:06 -04:00
b9d9a45c6a Update build.yml
[skip ci]
2021-03-31 10:31:53 -04:00
912a1f4176 add pandoc & docutils to final image 2021-03-30 17:51:44 -04:00
b807ac60eb Hugo v0.82.0 2021-03-21 17:10:28 -04:00
2cf9bd62af clone source from Git repo instead of downloading from GitHub release 2021-03-14 11:28:44 -04:00
30f54331e8 pin alpine to 3.13 2021-03-14 11:05:03 -04:00
791ec15da8 run CI on new tags 2021-03-08 06:46:43 -05:00
deaf886150 trim a layer off final stage 2021-03-07 15:34:45 -05:00
248ff169bd correct labeling of final image 2021-03-06 10:35:32 -05:00
9be7813071 update readme & random cleanup 2021-03-06 10:12:11 -05:00
783939f439 Switch to building from source for multi-platform images (#1)
...so we can support platforms that official releases don't exist for (namely Linux on ARM64). Just building x86_64 and ARM64 for now, so I can work on my M1 mac.
2021-03-06 09:09:17 -05:00
54f06a59e8 Hugo v0.81.0
also force AMD64 base image (ran into problems with Docker on Apple Silicon since there's no ARM Linux version of Hugo)
2021-02-20 22:57:25 -05:00
51c9c67055 Hugo v0.80.0 2021-01-02 10:13:59 -05:00
a105355628 Hugo v0.79.1 2020-12-19 11:09:19 -05:00
3f5b9205b7 Hugo v0.79.0 2020-11-27 10:00:57 -05:00
fcadd19550 Hugo v0.78.2 2020-11-17 10:11:39 -05:00
a956a18e6c add org.opencontainers.image.source label
https://docs.github.com/en/free-pro-team@latest/packages/managing-container-images-with-github-container-registry/connecting-a-repository-to-a-container-image#connecting-a-repository-to-a-container-image-on-the-command-line
2020-11-17 09:22:42 -05:00
c6fc7fd110 Hugo v0.78.1 2020-11-05 09:26:03 -05:00
a649d18bcb Hugo v0.78.0 2020-11-03 08:43:43 -05:00
36f0af41e7 Hugo v0.77.0 (and Go 1.15) 2020-10-30 18:01:09 -04:00
6 changed files with 249 additions and 86 deletions

92
.github/workflows/build.yml vendored Normal file
View File

@ -0,0 +1,92 @@
name: Build and Push
on:
push:
branches:
- master
pull_request:
branches:
- master
merge_group:
workflow_dispatch:
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-only-cancel-in-progress-jobs-or-runs-for-the-current-workflow
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
env:
HUB_IMAGE: jakejarvis/hugo-extended
GHCR_IMAGE: ghcr.io/jakejarvis/hugo-extended
jobs:
docker:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[skip ci]')"
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
fetch-depth: 0
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
if: ${{ github.ref == 'refs/heads/master' }}
uses: docker/login-action@v3
with:
username: jakejarvis
password: ${{ secrets.DOCKER_HUB_TOKEN }}
- name: Login to GitHub Container Registry
if: ${{ github.ref == 'refs/heads/master' }}
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GHCR_PAT }}
- name: Cache Docker layers
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Parse Hugo version
id: parse_version
run: |
HUGO_VERSION="$(grep -oP '(?<=^ARG HUGO_VERSION=).+$' Dockerfile)"
echo "HUGO_VERSION=$HUGO_VERSION" >> $GITHUB_OUTPUT
- name: Build and push
id: build
uses: docker/build-push-action@v5
with:
builder: ${{ steps.buildx.outputs.name }}
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm64
push: ${{ github.ref == 'refs/heads/master' }}
tags: "${{ env.HUB_IMAGE }}:latest,${{ env.GHCR_IMAGE }}:latest,${{ env.HUB_IMAGE }}:${{ steps.parse_version.outputs.HUGO_VERSION }},${{ env.GHCR_IMAGE }}:${{ steps.parse_version.outputs.HUGO_VERSION }}"
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
- name: Image digest
run: echo ${{ steps.build.outputs.digest }}
- name: Update hub description
uses: peter-evans/dockerhub-description@v4
if: ${{ github.ref == 'refs/heads/master' }}
with:
username: jakejarvis
password: ${{ secrets.DOCKER_HUB_TOKEN }}
repository: ${{ env.HUB_IMAGE }}
short-description: "✏️ Hugo Extended for x64 and ARM64 with PostCSS, Babel, Pandoc, and more baked in."
readme-filepath: ./README.md
enable-url-completion: true

View File

@ -1,52 +0,0 @@
name: Publish to GitHub Container Registry
on:
push:
# Publish `v*` tags as releases.
tags:
- v*
pull_request:
env:
IMAGE_NAME: hugo-extended
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build image
run: docker build . --file Dockerfile
# Push image to GitHub Container Registry
push:
runs-on: ubuntu-latest
if: github.event_name == 'push'
needs: build
steps:
- uses: actions/checkout@v2
- name: Build image
run: docker build . --file Dockerfile --tag $IMAGE_NAME
- name: Login to GitHub Container Registry
run: echo "${{ secrets.GHCR_PAT }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Push image to GitHub
run: |
IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME
# Change all uppercase to lowercase
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
# Strip git ref prefix from version
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
# Strip "v" prefix from tag name
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
echo IMAGE_ID=$IMAGE_ID
echo VERSION=$VERSION
# Push image with both version tag and `latest` tag
docker tag $IMAGE_NAME $IMAGE_ID:$VERSION
docker tag $IMAGE_NAME $IMAGE_ID:latest
docker push $IMAGE_ID:$VERSION
docker push $IMAGE_ID:latest

View File

@ -1,56 +1,149 @@
# Hugo doesn't require Go to run, *except* if you're using Hugo Modules. It's
# much easier to install Node on the Go base image than vice-versa.
FROM golang:1.14-alpine
# the following version can be overridden at image build time with --build-arg
ARG HUGO_VERSION=0.76.5
# remove/comment the following line completely to build with vanilla Hugo:
ARG HUGO_EXTENDED=1
# renovate: datasource=github-releases depName=gohugoio/hugo
ARG HUGO_VERSION=0.124.1
# remove/comment the following line completely to compile vanilla Hugo:
ARG HUGO_BUILD_TAGS=extended
# ---
# Hugo >= v0.81.0 requires Go 1.16+ to build
FROM golang:1.22-alpine3.18 AS build
# renew global args from above
# https://docs.docker.com/engine/reference/builder/#scope
ARG HUGO_VERSION
ARG HUGO_BUILD_TAGS
ARG CGO=1
ENV CGO_ENABLED=${CGO}
ENV GOOS=linux
ENV GO111MODULE=on
WORKDIR /go/src/github.com/gohugoio/hugo
# gcc/g++ are required to build SASS libraries for extended version
RUN apk add --update --no-cache \
gcc \
g++ \
musl-dev \
git
# clone source from Git repo:
RUN git clone \
--branch "v${HUGO_VERSION}" \
--single-branch \
--depth 1 \
https://github.com/gohugoio/hugo.git ./
# https://github.com/gohugoio/hugo/commit/241481931f5f5f2803cd4be519936b26d8648dfd
RUN go build -v -ldflags "-X github.com/gohugoio/hugo/common/hugo.vendorInfo=docker" -tags "$HUGO_BUILD_TAGS" && \
mv ./hugo /go/bin/hugo
# fix potential stack size problems on Alpine
# https://github.com/microsoft/vscode-dev-containers/blob/fb63f7e016877e13535d4116b458d8f28012e87f/containers/hugo/.devcontainer/Dockerfile#L19
RUN go install github.com/yaegashi/muslstack@latest && \
muslstack -s 0x800000 /go/bin/hugo
# ---
FROM alpine:3.18
# renew global args from above & pin any dependency versions
ARG HUGO_VERSION
# https://github.com/jgm/pandoc/releases
# renovate: datasource=github-releases depName=jgm/pandoc
ARG PANDOC_VERSION=3.1.13
# https://github.com/sass/dart-sass-embedded/releases
# renovate: datasource=github-releases depName=sass/dart-sass-embedded
ARG DART_SASS_VERSION=1.62.1
LABEL version="${HUGO_VERSION}"
LABEL repository="https://github.com/jakejarvis/hugo-docker"
LABEL homepage="https://jarv.is/"
LABEL maintainer="Jake Jarvis <jake@jarv.is>"
# only install libc6-compat & libstdc++ if we're building extended Hugo
# https://gitlab.com/yaegashi/hugo/commit/22f0d5cbd6114210ba7835468facbdee60609aa2
RUN apk update && \
apk add --no-cache \
# https://docs.github.com/en/free-pro-team@latest/packages/managing-container-images-with-github-container-registry/connecting-a-repository-to-a-container-image#connecting-a-repository-to-a-container-image-on-the-command-line
LABEL org.opencontainers.image.source="https://github.com/jakejarvis/hugo-docker"
# bring over patched binary from build stage
COPY --from=build /go/bin/hugo /usr/bin/hugo
# this step is intentionally a bit of a mess to minimize the number of layers in the final image
RUN set -euo pipefail && \
if [ "$(uname -m)" = "x86_64" ]; then \
ARCH="amd64"; \
elif [ "$(uname -m)" = "aarch64" ]; then \
ARCH="arm64"; \
else \
echo "Unknown build architecture, quitting." && exit 2; \
fi && \
# alpine packages
# libc6-compat & libstdc++ are required for extended SASS libraries
# ca-certificates are required to fetch outside resources (like Twitter oEmbeds)
apk add --update --no-cache \
ca-certificates \
tzdata \
git \
nodejs \
npm \
yarn \
go \
python3 \
py3-pip \
ruby \
${HUGO_EXTENDED:+libc6-compat libstdc++} && \
libc6-compat \
libstdc++ && \
update-ca-certificates && \
npm install --global postcss postcss-cli autoprefixer @babel/core @babel/cli && \
pip3 install --upgrade Pygments==2.* && \
# npm packages
npm install --global --production \
yarn \
postcss \
postcss-cli \
autoprefixer \
@babel/core \
@babel/cli && \
npm cache clean --force && \
# ruby gems
gem install asciidoctor && \
wget https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_${HUGO_EXTENDED:+extended_}${HUGO_VERSION}_Linux-64bit.tar.gz && \
wget https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_${HUGO_VERSION}_checksums.txt && \
grep hugo_${HUGO_EXTENDED:+extended_}${HUGO_VERSION}_Linux-64bit.tar.gz hugo_${HUGO_VERSION}_checksums.txt | sha256sum -c && \
tar xf hugo_${HUGO_EXTENDED:+extended_}${HUGO_VERSION}_Linux-64bit.tar.gz && \
mv ./hugo /usr/local/bin/ && \
chmod +x /usr/local/bin/hugo && \
rm -rf hugo_* LICENSE README.md
# verify everything's OK, exit otherwise
RUN hugo version && \
# python packages
python3 -m pip install --no-cache-dir --upgrade Pygments==2.* docutils && \
# manually fetch pandoc binary
wget -O pandoc.tar.gz https://github.com/jgm/pandoc/releases/download/${PANDOC_VERSION}/pandoc-${PANDOC_VERSION}-linux-${ARCH}.tar.gz && \
tar xf pandoc.tar.gz && \
mv ./pandoc-${PANDOC_VERSION}/bin/pandoc /usr/bin/ && \
chmod +x /usr/bin/pandoc && \
rm -rf pandoc.tar.gz pandoc-${PANDOC_VERSION} && \
# manually fetch Dart SASS binary (on x64 only)
if [ "$ARCH" = "amd64" ]; then \
wget -O sass-embedded.tar.gz https://github.com/sass/dart-sass-embedded/releases/download/${DART_SASS_VERSION}/sass_embedded-${DART_SASS_VERSION}-linux-x64.tar.gz && \
tar xf sass-embedded.tar.gz && \
mv ./sass_embedded/dart-sass-embedded /usr/bin/ && \
chmod +x /usr/bin/dart-sass-embedded && \
rm -rf sass-embedded.tar.gz sass_embedded; \
fi && \
# clean up some junk
rm -rf /tmp/* /var/tmp/* /var/cache/apk/* && \
# tell git to trust /src
git config --global --add safe.directory /src && \
# make super duper sure that everything went OK, exit otherwise
hugo env && \
go version && \
node --version && \
npm --version && \
yarn --version && \
postcss --version && \
autoprefixer --version && \
babel --version && \
pygmentize -V && \
asciidoctor --version
asciidoctor --version && \
pandoc --version && \
rst2html.py --version
# add site source as volume
VOLUME /src
WORKDIR /src
# expose live-refresh server
# expose live-refresh server on default port
EXPOSE 1313
ENTRYPOINT ["hugo"]

View File

View File

@ -1,8 +1,8 @@
# ✏️ [Hugo Extended](https://github.com/gohugoio/hugo) via Docker
# ✏️ [Hugo Extended](https://github.com/gohugoio/hugo) via Docker
[![Build docs](https://img.shields.io/docker/cloud/build/jakejarvis/hugo-extended?label=Docker%20Hub&logo=docker&logoColor=%23fff)](https://hub.docker.com/r/jakejarvis/hugo-extended)
[![Build](https://github.com/jakejarvis/hugo-docker/actions/workflows/build.yml/badge.svg?branch=master)](https://github.com/jakejarvis/hugo-docker/actions/workflows/build.yml)
A base image to ease local development of Hugo sites, including [Hugo Extended](https://gohugo.io/troubleshooting/faq/#i-get-tocss-this-feature-is-not-available-in-your-current-hugo-version) (with SASS/SCSS support) and optional third-party tools ([listed below](#third-party-software)).
A base image to ease local development of Hugo sites, including [Hugo Extended](https://gohugo.io/troubleshooting/faq/#i-get-tocss-this-feature-is-not-available-in-your-current-hugo-version) (with SASS/SCSS support) and optional third-party tools ([listed below](#third-party-software)). Now with [multi-architecture images](https://docs.docker.com/docker-for-mac/multi-arch/) for native AMD64 and ARM64 support!
## Usage
@ -35,15 +35,18 @@ When using Docker to run a live server (i.e. `hugo server`), you must pass `--bi
## Third-party software
Just in case, the final container includes a few small third-party tools that are required by certain optional Hugo features:
Just in case, the final Alpine Linux container includes a few small third-party tools that are required by certain optional Hugo features:
- [PostCSS (CLI)](https://github.com/postcss/postcss-cli)
- [PostCSS](https://github.com/postcss/postcss-cli)
- [Autoprefixer](https://github.com/postcss/autoprefixer)
- [Babel (CLI)](https://babeljs.io/)
- [Babel](https://babeljs.io/)
- [Pygments](https://pygments.org/)
- [Asciidoctor](https://asciidoctor.org/)
- [Pandoc](https://pandoc.org/)
- [Docutils](https://docutils.sourceforge.io/) / [RST](https://docutils.sourceforge.io/rst.html)
- [Embedded Dart Sass](https://github.com/sass/dart-sass-embedded) (amd64 only)
Node (with NPM and Yarn) and Go (for [Hugo Modules](https://gohugo.io/hugo-modules/) support) are also pre-installed.
Node (with NPM and Yarn), Go (for [Hugo Modules](https://gohugo.io/hugo-modules/) support), and Python are also pre-installed.
## Licenses

27
renovate.json Normal file
View File

@ -0,0 +1,27 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:base"
],
"automerge": true,
"platformAutomerge": true,
"regexManagers": [
{
"fileMatch": [
"^Dockerfile$"
],
"matchStrings": [
"# renovate: datasource=(?<datasource>.*?) depName=(?<depName>.*?)( versioning=(?<versioning>.*?))?( registryUrl=(?<registryUrl>.*?))?\\s.*?_VERSION=(?<currentValue>.*)\\s"
],
"versioningTemplate": "{{#if versioning}}{{{versioning}}}{{else}}semver{{/if}}"
}
],
"packageRules": [
{
"matchFiles": [
"^Dockerfile$"
],
"extractVersion": "^v(?<version>.*)$"
}
]
}