Docker for DevOps Engineers
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:
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
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>
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>
View Resource Usage Statistics for Containers
Use the below command to view resource usage statistics for one or more containers.
docker stats
View Processes Running Inside a Container
Use the below command to view the processes running inside a container.
docker top <container_id_or_name>
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>
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:)
Subscribe to my newsletter
Read articles from Imran Shaikh directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by