Day 16: Docker for DevOps Engineers ??

Day 16: 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.

Tasks

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

docker run - It is used to create a new container.

for detached mode: docker run -d <image name or id>

No alt text provided for this image

  • To create a container with port number:
  • command -?docker run -d -p 8080:80 <image-name>

No alt text provided for this image

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

Inspect provides you with a bunch of metadata about all the different objects managed by docker. This includes the following:-

  1. Containers.
  2. Images.
  3. Networks.
  4. Volumes.
  5. Contexts.
  6. Plugins.
  7. Nodes (swarm object).
  8. Services (swarm object).
  9. Secrets (swarm object).
  10. Configs (swarm object).

No alt text provided for this image
No alt text provided for this image
No alt text provided for this image

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

command -?docker port <container-name>

docker port Container-name [PRIVATE_PORT[/PROTO]]

No alt text provided for this image
No alt text provided for this image

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

docker stats : Show live usage for container statistics.

  • returns a live data stream for running containers

No alt text provided for this image
No alt text provided for this image

Options:

  • --all??-a: Show all containers (default shows just running)
  • --format: Pretty print images using a Go template
  • --no-stream: Disable streaming stats and only pull the first result

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

docker top: Display the running processes of a container.

command:?docker top <container>

No alt text provided for this image

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

docker save?: Save one or more images to a tar archive?

command :?docker save [options] [image]

option:?--output?,?-o?: Write to a file

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

command :?docker load [options]

options:

  • --input?,?-i : Read from tar archive file

No alt text provided for this image

I'm delighted you made it this far and I really appreciate it. Please spread the word to your peers. ????

Kowshik G Y

Digital Marketing Associate | Passionate About Digital Transformation & Audience Engagement

1 年

Register for our latest webinar on Managing applications with kubernetes.?? Registration Link: https://lnkd.in/ggysxK5g #docker #kubernetes #course #registernow

回复
Divya Saurav

Serving Notice || Git||Git Hub||Jenkins||Ansible||Docker||Kubernetes||Terraform||Aws

1 年

This is the first article related to docker.? Or 16th.?

回复
Varsha Verma ??

10k+ LinkedIn | LinkedIn Top Voice for Cloud Computing | Linkedin Top Voice DevOps | Tech Speaker | Senior Cloud Engineer | AWS | LINUX | DEVOPS | Terraform | DevOps Community Lead at TWS | Technical Content writer |

1 年

Going great ??

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

社区洞察

其他会员也浏览了