Workshop 1: Storage and Networks in Docker
Workshop 1: Storage and Networks in Docker Storage Let’s work with Docker volumes:
Create a Docker volume called “miweb”:
docker volume create miweb Create a container from the image php:7.4-apache, mounting the Docker volume in /var/www/html (the DocumentRoot of the server):
docker run -d --name my-apache-app -v miweb:/var/www/html -p 8080:80 php:7.4-apache Use the docker cp command to copy an index.html file (with your name) into /var/www/html:
echo "<h1>Javier Cruces</h1>" > index.html docker cp index.html my-apache-app:/var/www/html/ Access the container from the browser to check the index.html file: