Docker: Mounting host directory



$ docker run -it --rm -v /home/gabor/work/slides/docker/examples/python-3:/opt/  mydocker

$ docker run -it --rm -v c:\Users\Gabor Szabo\work\slides\docker\examples python-3:/opt/  mydocker

# cd /opt
# ls -l

The -v HOST:CONTAINER will mount the HOST directory of the home operating system to the CONTAINER directory in the Docker container.


# ./curl.py -I https://code-maven.com/slides


docker run -it --rm -v $(pwd):/opt/  mydocker