Day 16 Task: Docker for DevOps Engineers.

Day 16 Task: Docker for DevOps Engineers.

#90daysdevopschallenge

Docker

Docker is a software platform that allows you to build, test, and deploy applications quickly. Docker packages software into standardized units called containers that have everything the software needs to run including libraries, system tools, code, and runtime. Using Docker, you can quickly deploy and scale applications into any environment and know your code will run.

Docker also provides a tool called Docker Compose, which allows developers to define and run multi-container applications. It uses a YAML file to configure the application’s services and networks, and it can spin up and tear down entire environments with a single command.

Follow the below steps to setup docker

Steps 1 : Create a Ec2 instance in AWS.

Steps 2 : Install Docker in instance.

Commands:

· sudo apt-get update

· sudo apt-get install docker.io -y

· sudo service docker start

· sudo systemctl enable docker

· sudo usermod -a -G docker ubuntu

· Log out and log back in again to pick up the new docker group permissions. You can accomplish this by closing your current SSH terminal window and reconnecting to your instance in a new one. Your new SSH session will have the appropriate docker group permissions.

· docker info

Steps 3 : Create a Docker image

Commands :
· docker pull <image_name>
· docker run -d - name <container-name> -p <port mapping> <image_name:tag>

Tasks

  • Use the docker run command to start a new container and interact with it through the command line. [Hint: docker run hello-world]

    • Use the docker inspect command to view detailed information about a container or image.

      • Use the docker port command to list the port mappings for a container.

        • Use the docker status command to view resource usage statistics for one or more containers.

          • Use the docker top command to view the processes running inside a container.

  • Use the docker save command to save an image to a tar archive.

  • Use the docker load command to load an image from a tar archive.

THANK YOU FOR READING!