Day 19 Task: Docker for DevOps Engineers Part-3

Day 19 Task: Docker for DevOps Engineers Part-3

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.

Task-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 )

No alt text provided for this image

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

No alt text provided for this image

Use the?docker-compose scale?command to increase or decrease the number of replicas for a specific service. You can also add?replicas?in deployment file for?auto-scaling.

No alt text provided for this image

Use the?docker-compose ps?command to view the status of all containers

No alt text provided for this image

Use the docker-compose logs?to view the logs of a specific service.

No alt text provided for this image

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

No alt text provided for this image

Task-2

Learn how to use Docker Volumes and Named Volumes to share files and directories between multiple containers.

No alt text provided for this image

Create two or more containers that read and write data to the same volume using the?docker run --mount?command.

No alt text provided for this image

Verify that the data is the same in all containers by using the docker exec command to run commands inside each container.

No alt text provided for this image

Use the docker volume ls command to list all volumes

No alt text provided for this image

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

No alt text provided for this image

Thank you for taking time to read this article!

要查看或添加评论,请登录

Sayali Shewale的更多文章

  • DevOps Project-3

    DevOps Project-3

    Project Description The project involves hosting a static website using an AWS S3 bucket. Amazon S3 is an object…

    7 条评论
  • DevOps Project-2

    DevOps Project-2

    Project Description The project is about automating the deployment process of a web application using Jenkins and its…

    2 条评论
  • Day 80: DevOps Project-1

    Day 80: DevOps Project-1

    Project Description The project aims to automate the building, testing, and deployment process of a web application…

    4 条评论
  • Day 73 - Setup Grafana on AWS EC2 Instance

    Day 73 - Setup Grafana on AWS EC2 Instance

    Task: Setup grafana in your local environment on AWS EC2. Go to the AWS console and Launch an EC2 instance Open port…

    2 条评论
  • Day 72 - Grafana

    Day 72 - Grafana

    What is Grafana? Grafana is an open-source data visualization and monitoring tool that allows you to query, visualize…

    3 条评论
  • Day 70 - Terraform Modules

    Day 70 - Terraform Modules

    Modules are containers for multiple resources that are used together. A module consists of a collection of .

    2 条评论
  • Day 69 - Meta-Arguments in Terraform

    Day 69 - Meta-Arguments in Terraform

    When you define a resource block in Terraform, by default, this specifies one resource that will be created. To manage…

    1 条评论
  • Day 68 - Scaling with Terraform

    Day 68 - Scaling with Terraform

    Understanding Scaling Scaling is the process of adding or removing resources to match the changing demands of your…

  • Day 67: AWS S3 Bucket Creation and Management using terraform

    Day 67: AWS S3 Bucket Creation and Management using terraform

    AWS S3 Bucket Amazon S3 (Simple Storage Service) is an object storage service that offers industry-leading scalability,…

    1 条评论
  • Day 66 - Terraform Hands-on Project - Build Your Own AWS Infrastructure with Ease using Infrastructure as Code (IaC)

    Day 66 - Terraform Hands-on Project - Build Your Own AWS Infrastructure with Ease using Infrastructure as Code (IaC)

    Task: 1.Create a VPC (Virtual Private Cloud) with CIDR block 10.

    3 条评论

社区洞察

其他会员也浏览了