Skip to content

Commit 6eebb97

Browse files
Robbie1977claude
andcommitted
Set HUGO_CACHEDIR and WORKDIR in the builder image
The official Hugo image ships ENV HUGO_CACHEDIR=/cache. deploy.sh reads ${HUGO_CACHEDIR:-/tmp/hugo_cache}, so the default never fires and the cache lands in the container's writable layer rather than the volume mounted at /tmp: discarded on every run, and consuming host disk in between. The floryn90 image it replaces put the cache on /tmp, which is why this did not bite before. Set WORKDIR to /src for the same reason — upstream sets /project, which is not where the Jenkins workspace is mounted. deploy.sh cds to $SRC either way, but the image should not disagree with the service it runs in. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01X1AuLA5tHPwpD7Hp5utPkS
1 parent 3548d7c commit 6eebb97

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

‎Dockerfile‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,14 @@ FROM ghcr.io/gohugoio/hugo:v0.164.0
2727
USER root
2828
RUN apk add --no-cache bash rsync findutils
2929

30+
# The upstream image sets HUGO_CACHEDIR=/cache and WORKDIR /project. Both are
31+
# wrong here and neither can be left to deploy.sh's defaults: the script uses
32+
# ${HUGO_CACHEDIR:-/tmp/hugo_cache}, which never fires while the image has the
33+
# variable set, so the cache would land in the container's writable layer
34+
# instead of the volume mounted at /tmp — discarded every run, and growing host
35+
# disk in between. Rancher mounts the workspace at /src and the cache at /tmp.
36+
ENV HUGO_CACHEDIR=/tmp/hugo_cache
37+
WORKDIR /src
38+
3039
ENTRYPOINT []
3140
CMD ["/bin/bash", "/src/deploy.sh"]

0 commit comments

Comments
 (0)