Docker for DevOps Engineers

Imran ShaikhImran Shaikh
2 min read

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. Run a new container

    Use the below command to start a new container and interact with it through the command line. Make sure you have pulled the docker image.

docker run hello-world
  1. Inspect a Container or Image

    Use the below command to view detailed information about a container or image. (like configuration, environment variables, volumes)

docker inspect <container_id_or_image_name>
  1. List the Port Mappings for a Container

    Use the below command to list the port mappings for a container.(container to host)

docker port <container_id_or_name>
  1. View Resource Usage Statistics for Containers

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

docker stats
  1. View Processes Running Inside a Container

    Use the below command to view the processes running inside a container.

docker top <container_id_or_name>
  1. Save an Image to a Tar Archive

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

docker save -o <output_file.tar> <image_name>
  1. Load an Image from a Tar Archive

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

docker load -i <input_file.tar>

Happy Learning:)

0
Subscribe to my newsletter

Read articles from Imran Shaikh directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Imran Shaikh
Imran Shaikh