Day 16 Task: Docker for DevOps Engineers.

Day 16 Task: Docker for DevOps Engineers.

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.

Let's dive into some essential Docker tasks for DevOps engineers

Use the docker run command to start a new container and interact with it through the command line.

The “docker run” command is used to start a new container from an image.

For example, to start a new container from the “hello-world” image and interact with it through the command line, you can run the following command:

docker run hello-world

This command will pull the "hello-world" image from the Docker Hub registry (if it's not already available locally) and create a new container that displays the "hello-world" message.

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

The docker inspect command provides detailed information about a container or image. Those objects can be docker images, containers, networks, volumes, plugins, etc. By default, docker inspects returns information in JSON format.

docker inspect 3459ef3b3fce

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

docker port command will display a list of port mappings for a specific container.

docker port 3459ef3b3fce

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

The docker stats command provides real-time statistics on CPU, memory, and network usage for one or more containers

docker ststs 3459ef3b3fce

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

docker top will display the processes running inside the specified container.

docker top 3459ef3b3fce

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

The docker save command allows you to save an image to a tar archive.

docker save flask-app -o flask-app-backup.tar

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

If we receive a Docker image as a tar archive, you can load it back into Docker using the docker load command. This will load the image from the specified tar archive file and add it to your local image repository

Thank you for reading!

Contact me on Linkedin 🤝

Check out my GitHub for more resources 📚