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
Certainly! Here are examples of using the specified Docker commands:
Start a new container and interact with it:
docker run -it hello-world
This command runs the "hello-world" image interactively, meaning you can see the output and interact with it through the command line.
View detailed information about a container or image:
# For a container docker inspect <container_id_or_name> # For an image docker inspect <image_id_or_name>
Replace
<container_id_or_name>
and<image_id_or_name>
with the actual container or image ID or name.List port mappings for a container:
docker port <container_id_or_name>
View resource usage statistics for one or more containers:
docker stats <container_id_or_name>
Replace
<container_id_or_name>
with the actual container ID or name. You can monitor multiple containers by specifying their IDs or names separated by spaces.View processes running inside a container:
docker top <container_id_or_name>
Save an image to a tar archive:
docker save -o <output_file_name>.tar <image_id_or_name>
Replace
<output_file_name>
and<image_id_or_name>
with the desired output file name and the actual image ID or name.Load an image from a tar archive:
docker load -i <input_file_name>.tar
Replace
<input_file_name>
with the name of the input tar archive.
Remember to replace placeholders like <container_id_or_name>
and <image_id_or_name>
with the actual IDs or names. These commands will help you interact with and manage Docker containers and images.
HAPPY LEARNING !!!
Subscribe to my newsletter
Read articles from Salman Hisamuddin Ansari directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by