Decktape offers a Docker image in order to run their presentation converter. If you want to convert a presentation from an instance running on localhost
on a Mac, it is necessary to do some work around.
Decktape's Github Page suggests that we run the following command to save a presentation deployed locally:
>> docker run --rm --net=host -v `pwd`:/slides astefanutti/decktape http://localhost:8000 slides.pdf
However when running the docker from a Mac, Docker is actually running behind a virtual machine and has no access to the localhost. Thus the option --net=host
leads to a connection refused error.
In order to bypass this problem, we first need to find out what the IP address of the preferred network interface in the OSX host is, from this StackOverflow answer we use:
>> echo "show State:/Network/Global/IPv4" | scutil | grep PrimaryInterface | awk '{print $3}' | xargs ifconfig | grep inet | grep -v inet6 | awk '{print $2}'
10.226.98.247
With the IP address in hand, we can add a new host to the docker instance and then access the page from this added host:
>> docker run --rm --add-host dockerhost:10.226.98.247 -v `pwd`:/slides astefanutti/decktape http://dockerhost:8000 slides.pdf