Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v1.36.0 Docker Image Tries to Create /cache #12946

Closed
theory opened this issue Oct 15, 2024 · 5 comments
Closed

v1.36.0 Docker Image Tries to Create /cache #12946

theory opened this issue Oct 15, 2024 · 5 comments

Comments

@theory
Copy link
Contributor

theory commented Oct 15, 2024

What version of Hugo are you using (hugo version)?

1.36.0

Does this issue reproduce with the latest release?

Yes.

Issue

The v1.36.0 Docker image appears to try to create the directory /cache/. See, for example, this Workflow run, which errors with:

Error: failed to load config: failed to create cache dir: mkdir /cache/: permission denied

This was not the case with v1.35.0. The only change in that workflow build is:

--- a/.github/workflows/publish.yml
+++ b/.github/workflows/publish.yml
@@ -8,8 +8,8 @@ jobs:
       - name: Check out Source
         uses: actions/checkout@v4
       - name: Build the Site
-        uses: docker://ghcr.io/gohugoio/hugo:v0.135.0
-        with: { entrypoint: hugo }
+        uses: docker://ghcr.io/gohugoio/hugo:v0.136.0
+        with: { args: build }
       - name: Generate Publish Script
         run: ./bin/publish public justatheory.com E1X44SJ45FTNGI 1 > publish.sh
       - name: Publish the Site
@bep
Copy link
Member

bep commented Oct 15, 2024

Look at my "note" comment in the release notes. Documentation will follow, but if you follow some of the links in the release notes, there are some context.

@bep bep closed this as completed Oct 15, 2024
@theory
Copy link
Contributor Author

theory commented Oct 15, 2024

Hmmm…I see this line; I don't think I uses any caching, though. Happy to await doc updates.

@bep
Copy link
Member

bep commented Oct 15, 2024

@theory everyone who uses Hugo use caching to some extent. I guess I forgot to link to PR #12921 in the release notes that had the most relevant info.

Example Docker run:

docker run --rm -v .:/project -v $HOME/Library/Caches/hugo_cache:/cache imagename build

We now expect a mount from the host to /cache in the container that we use as the value for HUGO_CACHEDIR.

We could (should?) possibly make this optional (or at least validate and throw a better error), but this is very important, especially for larger Hugo sites that do image processing; with the above you would have a Hugo cache that's not thrown away with the container.

@theory
Copy link
Contributor Author

theory commented Oct 15, 2024

Ah-hah. I wonder if I should sue the caching action. My builds are always super fast, though.

Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 19, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants