DevOps(Day-21) : Docker Network and Volumes for DevOps

 

  • Docker-Volume

  • Docker-Network

Docker allows mounting the filesystems as a volume to the containers. These volumes preserve all the data of the container and the data is persisted even if the container is deleted.

The default path is /var/lib/docker/volumes/ on Linux.

How to use volumes to share data between Docker containers | by Edouard  Courty | Medium

A volume can be mounted to multiple containers and it lies even if all containers are down. It can be removed only manually by the user.

  1. Creating a Docker Volume

      $docker volume create [volume_name]
    
  2. Listing a Docker Volume

      $docker volume list
    
  3. Mounting a volume.

      docker run --mount source=[volume_name],destination=[path_in_container] [docker_image]
    
  4. Removing a Volume.

      $docker volume rm [volume_name]
    
  5. Deleting all volumes at once.

      $docker volume prune
    

With Docker-Compose we create multiple containers, in that process, a space is created by Docker where those containers can communicate with each other and the host system. That space is known as Docker Network.

what are the different types of docker networking drivers | Edureka  Community

$docker network COMMAND

The COMMAND can be connected, create, disconnect, inspect, ls, prune, and rm.

Thanks for reading my article. Have a nice day.

Comments

Popular posts from this blog

DevOps(Day-97): Meta-Arguments in Terraform

DevOps(Day-95): Auto Scaling with Terraform

DevOps (Day-1) Introduction