DEV Community

Cover image for Storing Container Data In Docker Volumes
Sami Ullah Saleem for AWS Community Builders

Posted on

4

Storing Container Data In Docker Volumes

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.

Anonymous Volume

Now, lets inspect the volume using the following command

Inspect Information

2- Create a Docker Volume

~ docker volume create webiste
~ docker volume ls
Enter fullscreen mode Exit fullscreen mode

Creating Volume using docker

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
Enter fullscreen mode Exit fullscreen mode

4- Clean Up Unused Volumes

~ docker volume prune
Enter fullscreen mode Exit fullscreen mode

Qodo Takeover

Introducing Qodo Gen 1.0: Transform Your Workflow with Agentic AI

While many AI coding tools operate as simple command-response systems, Qodo Gen 1.0 represents the next generation: autonomous, multi-step problem-solving agents that work alongside you.

Read full post

Top comments (0)

Best Practices for Running  Container WordPress on AWS (ECS, EFS, RDS, ELB) using CDK cover image

Best Practices for Running Container WordPress on AWS (ECS, EFS, RDS, ELB) using CDK

This post discusses the process of migrating a growing WordPress eShop business to AWS using AWS CDK for an easily scalable, high availability architecture. The detailed structure encompasses several pillars: Compute, Storage, Database, Cache, CDN, DNS, Security, and Backup.

Read full post

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay