🐳 A simple docker image for pandoc with filters, templates, fonts, and the latex bazaar
See the codeA simple docker image for pandoc with filters, templates, fonts and additional tools.
Download the image with:
docker pull dalibo/pandocker:stable
Whenever a new stable version is released, launch that command again to refresh your image.
Run dalibo/pandocker with regular pandoc args. Mount your files at /pandoc.
docker run --rm -u `id -u`:`id -g` -v `pwd`:/pandoc dalibo/pandocker README.md -o README.pdf
Notes about the docker options:
-v ... option will mount the current folder as the /pandoc directory
inside the container. If SELinux is enabled on your system, you might need to
add the --privileged tag to force access to the mouting points. For more
details, read the documentation about docker runtime privileges.The --rm option destroys the container once the document is produced.
This is not mandatory but it's a good practice.
The -u option ensures that the output files will belong to you.
Again this is not necessary but it's useful.
Tip: You can define a shell alias to use
pandockerjust likepandoc. Add this to your~/.bashrc:
alias pandoc="docker run --rm -u `id -u`:`id -g` -v `pwd`:/pandoc dalibo/pandocker:stable"
pandoc README.md -o README.epub
Alternatively, you can use a pipe like this:
cat foo.md | docker run --rm -i dalibo/pandocker -t pdf > foo.pdf
This method will not work if the source document contains images or includes...
We're shipping a selection of latex templates inside the image so that you can produce nice PDF documents without installing anything.
So far, we provide the 3 templates below:
pdflatex and xelatex.You can use them simply by adding --template=xxx to your compilation
lines:
docker run [...] --pdf-engine=xelatex --template=eisvogel foo.md -o foo.pdf
Each template has specific variables that you can use to adapt the document. Please go the project page of each template for more details.
This docker image embeds a number of useful pandoc filters. You can simply
enable them by adding the option --filter xxx where xxx is the name of
one of the following filters below:
NOTE: By default when using the pandoc-include filter, the path to target
files is relative to the /pandoc mountpoint. For instance,
the !include [foo/bar.md] statement will look for a /pandoc/foo/bar.md file.
You can use the docker arg --workdir="some/place/elsewhere" to specify
another location. The same principle applies to the pandoc-codeblock-include
and pandoc-mustache filters.
The pandocker image includes the following open-source fonts:
The image is available in 2 versions named as follows:
latest (default): image containing the most recent changesstable: image based on the latest stable releaseYou can also the release names for instance
docker pull dalibo/pandocker:24.05
The previous versions add more complex tags such as latest-ubuntu-extra
or stable-buster.
We also provided alternative image named latest-full and stable-full`.
They are not supported anymore.
Use make or docker build .
The docker image embeds additional software related to editing and publishing:
These tools can be called by modifying the entrypoint of the image. For instance,
you can convert a dia source file into an SVG image like this:
docker run [..] --entrypoint dia dalibo/pandocker foo.dia -e foo.svg
When using pandocker, you may encounter the following error message:
$ docker run --rm -u `id -u`:`id -g` -v `pwd`:/pandoc dalibo/pandocker foo.md
pandoc: "filename": openBinaryFile: does not exist (No such file or directory)
This means that docker could not mount the local directory as a volume and
therefore pandoc cannot see the file foo.md inside the container. There might
be several reasons for that, here a few ideas to try:
Add --privileged option to the pandocker command line. Read more about
this docker privileged mode here :
https://docs.docker.com/engine/reference/run/#runtime-privilege-and-linux-capabilities
Check if you have SELinux enforced on you system, with the command below:
sestatus
If the SELinux mode is enforced, you can try to lower it to permissive.
More info about SELinux here: https://fedoraproject.org/wiki/SELinux_FAQ
Shell
44.9%
TeX
22.0%
Dockerfile
20.5%
HTML
7.7%
Makefile
4.9%
🐳 A simple docker image for pandoc with filters, templates, fonts, and the latex bazaar
See the codeA simple docker image for pandoc with filters, templates, fonts and additional tools.
Download the image with:
docker pull dalibo/pandocker:stable
Whenever a new stable version is released, launch that command again to refresh your image.
Run dalibo/pandocker with regular pandoc args. Mount your files at /pandoc.
docker run --rm -u `id -u`:`id -g` -v `pwd`:/pandoc dalibo/pandocker README.md -o README.pdf
Notes about the docker options:
-v ... option will mount the current folder as the /pandoc directory
inside the container. If SELinux is enabled on your system, you might need to
add the --privileged tag to force access to the mouting points. For more
details, read the documentation about docker runtime privileges.The --rm option destroys the container once the document is produced.
This is not mandatory but it's a good practice.
The -u option ensures that the output files will belong to you.
Again this is not necessary but it's useful.
Tip: You can define a shell alias to use
pandockerjust likepandoc. Add this to your~/.bashrc:
alias pandoc="docker run --rm -u `id -u`:`id -g` -v `pwd`:/pandoc dalibo/pandocker:stable"
pandoc README.md -o README.epub
Alternatively, you can use a pipe like this:
cat foo.md | docker run --rm -i dalibo/pandocker -t pdf > foo.pdf
This method will not work if the source document contains images or includes...
We're shipping a selection of latex templates inside the image so that you can produce nice PDF documents without installing anything.
So far, we provide the 3 templates below:
pdflatex and xelatex.You can use them simply by adding --template=xxx to your compilation
lines:
docker run [...] --pdf-engine=xelatex --template=eisvogel foo.md -o foo.pdf
Each template has specific variables that you can use to adapt the document. Please go the project page of each template for more details.
This docker image embeds a number of useful pandoc filters. You can simply
enable them by adding the option --filter xxx where xxx is the name of
one of the following filters below:
NOTE: By default when using the pandoc-include filter, the path to target
files is relative to the /pandoc mountpoint. For instance,
the !include [foo/bar.md] statement will look for a /pandoc/foo/bar.md file.
You can use the docker arg --workdir="some/place/elsewhere" to specify
another location. The same principle applies to the pandoc-codeblock-include
and pandoc-mustache filters.
The pandocker image includes the following open-source fonts:
The image is available in 2 versions named as follows:
latest (default): image containing the most recent changesstable: image based on the latest stable releaseYou can also the release names for instance
docker pull dalibo/pandocker:24.05
The previous versions add more complex tags such as latest-ubuntu-extra
or stable-buster.
We also provided alternative image named latest-full and stable-full`.
They are not supported anymore.
Use make or docker build .
The docker image embeds additional software related to editing and publishing:
These tools can be called by modifying the entrypoint of the image. For instance,
you can convert a dia source file into an SVG image like this:
docker run [..] --entrypoint dia dalibo/pandocker foo.dia -e foo.svg
When using pandocker, you may encounter the following error message:
$ docker run --rm -u `id -u`:`id -g` -v `pwd`:/pandoc dalibo/pandocker foo.md
pandoc: "filename": openBinaryFile: does not exist (No such file or directory)
This means that docker could not mount the local directory as a volume and
therefore pandoc cannot see the file foo.md inside the container. There might
be several reasons for that, here a few ideas to try:
Add --privileged option to the pandocker command line. Read more about
this docker privileged mode here :
https://docs.docker.com/engine/reference/run/#runtime-privilege-and-linux-capabilities
Check if you have SELinux enforced on you system, with the command below:
sestatus
If the SELinux mode is enforced, you can try to lower it to permissive.
More info about SELinux here: https://fedoraproject.org/wiki/SELinux_FAQ
Shell
44.9%
TeX
22.0%
Dockerfile
20.5%
HTML
7.7%
Makefile
4.9%