Docker Part 2 Assignment - 1
Tasks To Be Performed:
- Launch the Apache2 container created in previous module
- Create a Docker volume on /var/www/html
Please submit the commands in order to complete this assignment.
Step 1:
I will use the Apache2 container that we pushed to DockerHub in Case Study 1 โ Containerization Using Docker โ Part 1
Step 2:
First, I create a volume: volume-sample
docker volume create volume-sample
Then, I verify its creation by running:
docker volume ls
Now, I run a container from the image that was pushed to DockerHub in Case Study 1 โ Containerization Using Docker โ Part 1, and I attach the newly created Docker volume named volume-sample
.
I run a Docker container and attached the newly created volume to it
docker run -it --mount source="volume-sample",destination="/var/www/html" -p 8080:80 -d hectorproko/my_docker_image:my_apache_image2
I verify the container works by curl
ing the page from localhost