Hi all,
What I’m doing
In a CI (Jenkins), I’m trying to launch hugo to generate HTML file which contains an API documentation. The process is the following:
Jenkins slave --> launch sbt (Scala Build Tool) in a Docker --> Launch Hugo in Docker
All volumes (project and public directories) are well mounted otherwise hugo would have tell me that project/content does not exist.
What I’m expecting ? .
Hugo generates HTML file in public which is mounted with a host directory
What actually happened
I receive this error from Hugo:
Error: failed to create file caches from configuration: this is a filesystem that does nothing and this operation is not supported
But unfortunately, I have no detail to help me fixing this error
Why Hugo said that the filesystem does nothing ?
I tried to mount an anonymous volume in docker (-v /tmp
) and set cache dir (-e HUGO_CACHEDIR=/tmp
) and I also tried to set cacheDir parameter when launching Hugo but nothing solved this issue.
Hugo version is 0.54.0 and Docker image is Alpine:3.8
I also tried to activated --verbose
but it does not produce more log (only the one I posted in this tread).
I’m sorry but I can’t share my private repository. Creating a dummy repository will also be a very hard task but if no one has a solution, I’ll try do create one.
Here is the script which is launched from sbt:
docker build -t hugo - <<EOF
FROM alpine:3.8
RUN wget https://github.com/gohugoio/hugo/releases/download/v0.54.0/hugo_0.54.0_Linux-
64bit.tar.gz && \
tar xvzf hugo_* && \
rm -rf hugo_* LICENSE README.md && \
mv /hugo /usr/local/bin
ENTRYPOINT ["hugo"]
EOF
USERID=$(id -u)
GROUPID=$(id -g)
#-------------------------------------------
# Assume following parameters :
# $1 The source directory (content, css, js, ...)
# $2 The destination directory of generated HTML files
#-------------------------------------------
# The following substitutions aim to fix the Docker-next-to-Docker when
# mounting volume (source volume are from the HOST, not the middle container)
HUGO_SOURCE="${1/$REPO_ROOT/$REPO_ROOT_HOST}"
HUGO_DEST="${2/$REPO_ROOT/$REPO_ROOT_HOST}"
echo "Generating $HUGO_DEST files from $HUGO_SOURCE files"
docker run --rm -i \
-u ${USERID}:${GROUPID} \
-v ${HUGO_SOURCE}:/site:ro \
-v ${HUGO_DEST}:/public:rw \
-v /tmp \
-e HUGO_CACHEDIR=/tmp \
-w /site \
hugo \
--destination /public --cacheDir /tmp --verbose
Thanks for your help