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

Compare commits

..

2 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

View File

@ -1,11 +1,11 @@
# the following version can be overridden at image build time with --build-arg
ARG HUGO_VERSION=0.110.0
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.19
ARG ALPINE_VERSION=3.16
ARG ALPINE_VERSION=3.17
# ---
@ -55,7 +55,7 @@ ARG HUGO_VERSION
# https://github.com/jgm/pandoc/releases
ARG PANDOC_VERSION=2.19.2
# https://github.com/sass/dart-sass-embedded/releases
ARG DART_SASS_VERSION=1.57.1
ARG DART_SASS_VERSION=1.58.3
LABEL version="${HUGO_VERSION}"
LABEL repository="https://github.com/jakejarvis/hugo-docker"
@ -122,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 && \