Sunday, March 19, 2017

Command-line Docker tip

If you're developing/running command line tools in Docker containers, you'll probably want the tool to know from what folder you're running the tool. To do this, you'll want to pass the "-v `pwd`:/source" option, where:

"pwd" (surrounded by backticks) is aliased to the working directory within the container

"/source" is the internal working directory within the container

For this (above and below) example, I'm using the Pandoc container, developed by jagregory. If I save the script (below) as "md2pdf", the syntax to run it would be something like: