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

Compare commits

...

11 Commits

Author SHA1 Message Date
03b1766d3a Update Dockerfile 2023-03-15 09:58:18 -04:00
b30a0a27a4 Update renovate.json 2023-03-15 09:57:43 -04:00
11f87f7979 Update renovate.json 2023-03-15 09:51:50 -04:00
f9afc458d0 Add renovate.json 2023-03-15 13:45:56 +00: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
3 changed files with 37 additions and 16 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,15 +1,14 @@
# the following version can be overridden at image build time with --build-arg
ARG HUGO_VERSION=0.109.0
# renovate: datasource=github-releases depName=gohugoio/hugo
ARG HUGO_VERSION=0.111.3
# 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
# ---
FROM golang:${GO_VERSION}-alpine${ALPINE_VERSION} AS build
# Hugo >= v0.81.0 requires Go 1.16+ to build
FROM golang:1.19-alpine3.17 AS build
# renew global args from above
# https://docs.docker.com/engine/reference/builder/#scope
@ -48,14 +47,16 @@ RUN go install github.com/yaegashi/muslstack@latest && \
# ---
FROM alpine:${ALPINE_VERSION}
FROM alpine:3.17
# 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=2.19.2
# https://github.com/sass/dart-sass-embedded/releases
ARG DART_SASS_VERSION=1.57.1
# renovate: datasource=github-releases depName=sass/dart-sass-embedded
ARG DART_SASS_VERSION=1.59.3
LABEL version="${HUGO_VERSION}"
LABEL repository="https://github.com/jakejarvis/hugo-docker"
@ -122,6 +123,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 && \

18
renovate.json Normal file
View File

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