Being both nonprivileged and root inside Docker container
0
I want to use pandoc inside docker. The image looks like this: FROM debian:buster-slim RUN apt-get update && apt-get install -y pandoc texlive WORKDIR /home This is build.sh inside the project: cp *.ttf /usr/local/share/fonts/ && fc-cache; pandoc -o output.pdf input.md that I want to run like this: docker run --rm -t -v $(pwd):/home pandoc_container build.sh This results in output.pdf being owned by root on my host. When doing: docker run --user $(id -u) --rm -t -v $(pwd):/home pandoc_container build.sh instead, the file will be owned by me, but the font files can not be copied to that dir, due to missing write permissions. Adding RUN chmod a+w /usr/local/share/fonts/ to the Dockerfile solves this, but then the command fc-cache fails with a lot of failed to write cache er