Q:

Save a file generated by app running on docker to a given path in the host machine

I have a python app running on a docker container and it generates a pdf file. I want to store the generated pdf file in a given path in the host machine.
I am not sure on how can this be achieved. Any ideas? 

A:

Mount a volume in your container mapped to the desired path in your host
docker run -d -v /host/path:/python_app/output your_docker_image

Where /python_app/output is the path inside the container where your app is writing the pdf file.
Note that /host/path should have enough permissions
chmod 777 /host/path

