# Day-19 : Docker  For DevOps Engineers

## Docker-Volume

Docker allows you to create something called volumes. Volumes are like separate storage areas that can be accessed by containers. They allow you to store data, like a database, outside the container, so it doesn't get deleted when the container is deleted. You can also mount from the same volume and create more containers having same data.

## Docker Network

Docker allows you to create virtual spaces called networks, where you can connect multiple containers (small packages that hold all the necessary files for a specific application to run) together. This way, the containers can communicate with each other and with the host machine (the computer on which the Docker is installed). When we run a container, it has its own storage space that is only accessible by that specific container. If we want to share that storage space with other containers, we can't do that.

1\. Create a multi-container docker-compose file which will bring UP and bring DOWN containers in a single shot ( Example - Create application and database container )

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1708429332184/fbe718d1-fcc0-4cd2-bc44-7bfe0756872c.png align="left")

2\. Use the **docker-compose up** command with the -d flag to start a multi-container application in detached mode.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1708429370272/accd2d54-f751-4f85-a3aa-cef5d4d49101.png align="left")

3\. Use the docker-compose images and docker-compose ps  command to view the status of all images and containers

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1708429626159/6f7744c8-7cd8-4152-b383-646128a8402d.png align="left")

4.Use the docker-compose down command to stop and remove all containers, networks, and volumes associated with the application

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1708429777514/b83b0603-5888-4f74-bb16-adc1001abcb5.png align="left")

5.Use the docker volume ls command to list all volumes

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1708430341100/00811c33-a3b8-47f6-b884-49c93a2c39d1.png align="left")

6.Use the docker volume rm command to remove the volume when you're done

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1708430365541/cb9cceb9-a659-42c8-b2d1-294fe53e8a1a.png align="left")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1708430748400/5a98f97b-c2af-4072-a9be-f0c7a9e70794.png align="center")

Thank you for reading this Article.
