I have created this demo for a stackoverflow question in here
dockerfile
is used to have a python based container.
main.py
writes few bytes to a file in a folder defined as a variable in environment
container is run adding a folder mapping between host and container.