Accueil‎ > ‎

Docker - use current working directory files

posted 20 Feb 2018, 00:25 by Christophe Noël

To use the file from the current directory of the local machine, it is possible to refer the current directory with the variable $PWD.

The following command will run the apache http service and will mount the files from the current directory in the apache2/htdocs directory.

docker run -dit --name my-apache-app -p 8080:80 -v "$PWD":/usr/local/apache2/htdocs/ httpd:2.4