Skip to content

Instantly share code, notes, and snippets.

@hammerill
Last active July 15, 2025 14:33
Show Gist options
  • Save hammerill/095b5270d9b393f44f4366b32b6f51a8 to your computer and use it in GitHub Desktop.
Save hammerill/095b5270d9b393f44f4366b32b6f51a8 to your computer and use it in GitHub Desktop.
Pandoc Docker

Pandoc Docker

Instead of installing Pandoc directly on your machine (and possibly signing a contract to clean the ass of all its haskell dependencies) you can just use it with a Docker run script (accessible as pandoc from all the scripts).

~/.local/bin/pandoc:

#!/bin/bash

docker run --rm -v "$(pwd):/data:z" -u "$(id -u)":"$(id -g)" pandoc/extra "$@"

Make sure the file is executable and in the PATH.

Now you can use pandoc command as if it was installed in your system.

This is more practical than the alias seen here because a script inside PATH is accessible from other scripts. Meaning that executing a script which calls pandoc poses no problems.

Bonus

See the :z thing in the volume (-v) parameter? It's used to bypass the SELinux read/write permission denying policy. Thanks Gemini. I would spend hours trying to fix this problem. Now it's just one single prompt.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment