Day 16 Task: 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
1. Run a New Container
Question: How do you use Docker to pull and run the
hello-world
container to ensure Docker is properly set up?Command:
docker run hello-world
2. Inspect a Container or Image
Question: How can you retrieve detailed information (like configuration, environment variables, volumes) about a specific Docker container or image using Docker commands?
Command:
docker inspect <container_id_or_image_name>
3. List the Port Mappings for a Container
Question: Which Docker command allows you to see the port mappings (container to host) for a running container?
Command:
docker port <container_id_or_name>
4. View Resource Usage Statistics for Containers
Question: How can you monitor resource usage (such as CPU, memory, and network I/O) for all or specific Docker containers in real time?
Command:
docker stats
5. View Processes Running Inside a Container
Question: Which command shows the list of active processes running inside a Docker container, similar to the
top
command on Linux?Command:
docker top <container_id_or_name>
6. Save an Image to a Tar Archive
Question: How can you export a Docker image as a
.tar
archive file for backup or sharing purposes?Command:
docker save -o <output_file.tar> <image_name>
7. Load an Image from a Tar Archive
Question: If you have a Docker image saved in a
.tar
archive, how can you load it back into Docker?Command:
docker load -i <input_file.tar>
#HappyLearning ๐
Subscribe to my newsletter
Read articles from Faizan Shaikh directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by