Creates a Docker image with Pandoc, TeX packages to run the eisvogel template, Node.js, and mermaid-filter.
To fetch the latest automated build image from Docker Hub
docker pull tewarid/pandoc
This pulls the latest tag built from main branch and may not always be stable, hence it is recommended you pull a stable tag
docker pull tewarid/pandoc:latest
Stable versions are tagged manually from latest and pushed to Docker Hub
docker tag tewarid/pandoc:latest tewarid/pandoc:1.0
docker push tewarid/pandoc:1.0
To build a new image
docker build -t tewarid/pandoc:latest .
Assuming you have a bash script run-pandoc.sh
on the host such as
#!/bin/sh
pandoc title.md doc.md -f markdown -o doc.pdf --toc -F mermaid-filter --template ./eisvogel.tex --variable titlepage=true --variable caption-justification=centering
Here's how you can invoke it in a Docker container
docker run -v `pwd`:/workdir -w /workdir -i -t --name pandoc-container --entrypoint "/workdir/run-pandoc.sh" tewarid/pandoc:1.0
On Windows, an equivalent PowerShell command may look like
docker run -i -t -v ${PWD}:/workdir -w /workdir --name pandoc-container --entrypoint "/bin/sh ./run-pandoc.sh" tewarid/pandoc:1.0
To run the same script again
docker start -a -i pandoc-container
Remove the container when no longer needed
docker rm pandoc-container
-
You will get an error message such as the following with mermaid-filter
events.js:292 throw er; // Unhandled 'error' event ^ Error: ENOENT: no such file or directory, open '/tmp/tmp-11UOaQJNu37LGm.tmp.png' Emitted 'error' event on ReadStream instance at: at internal/fs/streams.js:136:12 at FSReqCallback.oncomplete (fs.js:156:23) { errno: -2, code: 'ENOENT', syscall: 'open', path: '/tmp/tmp-11UOaQJNu37LGm.tmp.png' } Error running filter mermaid-filter: Filter returned error status 1
To fix it, create a file called
.puppeteer.json
in the directory you run pandoc, that contains{ "executablePath": "/usr/bin/chromium-browser", "args": ["--no-sandbox"] }