Sami Ullah Saleem
Posted on August 14, 2023
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
💖 💪 🙅 🚩
Sami Ullah Saleem
Posted on August 14, 2023
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.
Related
kubernetes Kubernetes Multiple Schedulers: A Step-by-Step Guide to Implementing a Custom Scheduler
November 20, 2024
undefined Dockerfile Essentials: Building and Customizing Docker Images for Your Application
November 19, 2024