Let's learn about volumes in Docker
What you will learn?
- Anonymous Volumes
- Create a Docker Volume
- Use the Website Volume with Containers
- Clean Up Unused Volumes
1. Anonymous Volumes
When we create a container then automatically docker creates an anonyous volume for that container.
Now, lets inspect the volume using the following command
2- Create a Docker Volume
~ docker volume create webiste
~ docker volume ls
3. Use the Website Volume with Containers
~ docker run -d --name web1 -p 80:80 -v webiste:/usr/local/apache2/htdocs:ro httpd:2.4
4- Clean Up Unused Volumes
~ docker volume prune
Top comments (0)