1
mirror of https://github.com/jakejarvis/hugo-docker.git synced 2025-06-30 20:56:38 -04:00

Compare commits

..

61 Commits

Author SHA1 Message Date
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
2 changed files with 22 additions and 18 deletions

View File

@ -14,7 +14,7 @@ jobs:
if: "!contains(github.event.head_commit.message, '[skip ci]')"
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Prepare tags
id: tag
@ -34,16 +34,16 @@ jobs:
echo ::set-output name=tags::${TAGS}
- name: Set up QEMU
uses: docker/setup-qemu-action@master
uses: docker/setup-qemu-action@v2
with:
platforms: all
platforms: linux/amd64,linux/arm64
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@master
uses: docker/setup-buildx-action@v2
- name: Cache Docker layers
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
@ -52,14 +52,14 @@ jobs:
- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
username: jakejarvis
password: ${{ secrets.DOCKER_HUB_TOKEN }}
- name: Login to GitHub Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
@ -67,7 +67,7 @@ jobs:
- name: Build and push
id: build
uses: docker/build-push-action@v2
uses: docker/build-push-action@v3
with:
builder: ${{ steps.buildx.outputs.name }}
context: ./

View File

@ -1,14 +1,15 @@
# the following version can be overridden at image build time with --build-arg
ARG HUGO_VERSION=0.84.4
ARG HUGO_VERSION=0.111.0
# 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
ARG GO_VERSION=1.16
ARG GO_VERSION=1.19
ARG ALPINE_VERSION=3.17
# ---
FROM golang:${GO_VERSION}-alpine3.13 AS build
FROM golang:${GO_VERSION}-alpine${ALPINE_VERSION} AS build
# renew global args from above
# https://docs.docker.com/engine/reference/builder/#scope
@ -27,8 +28,7 @@ RUN apk add --update --no-cache \
gcc \
g++ \
musl-dev \
git && \
go get github.com/magefile/mage
git
# clone source from Git repo:
RUN git clone \
@ -37,23 +37,25 @@ RUN git clone \
--depth 1 \
https://github.com/gohugoio/hugo.git ./
RUN mage -v hugo && mage install
# 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 get github.com/yaegashi/muslstack && \
RUN go install github.com/yaegashi/muslstack@latest && \
muslstack -s 0x800000 /go/bin/hugo
# ---
FROM alpine:3.13
FROM alpine:${ALPINE_VERSION}
# renew global args from above & pin any dependency versions
ARG HUGO_VERSION
# https://github.com/jgm/pandoc/releases
ARG PANDOC_VERSION=2.14
ARG PANDOC_VERSION=2.19.2
# https://github.com/sass/dart-sass-embedded/releases
ARG DART_SASS_VERSION=1.0.0-beta.7
ARG DART_SASS_VERSION=1.58.3
LABEL version="${HUGO_VERSION}"
LABEL repository="https://github.com/jakejarvis/hugo-docker"
@ -120,6 +122,8 @@ RUN set -euo pipefail && \
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 && \