0
0
Dockerdevops~15 mins

Restarting containers in Docker - Mini Project: Build & Apply

Choose your learning style9 modes available
Restarting containers
📖 Scenario: You are managing a small web application running inside a Docker container. Sometimes the container needs to be restarted to apply updates or fix issues.
🎯 Goal: You will learn how to list running containers, identify a container by name, and restart it using Docker commands.
📋 What You'll Learn
List all running Docker containers
Identify a container by its name
Restart a specific Docker container by name
💡 Why This Matters
🌍 Real World
Restarting containers is a common task when updating applications or fixing issues without stopping the entire system.
💼 Career
DevOps engineers and system administrators often restart containers to deploy updates or recover from errors quickly.
Progress0 / 4 steps
1
List running Docker containers
Run the command docker ps to list all currently running Docker containers.
Docker
Need a hint?

Use the docker ps command to see running containers.

2
Identify the container by name
Use the command docker ps --filter "name=webapp" to list running containers with the exact name webapp.
Docker
Need a hint?

Use the --filter "name=webapp" option to find the container named webapp.

3
Restart the container named 'webapp'
Run the command docker restart webapp to restart the container named webapp.
Docker
Need a hint?

Use docker restart webapp to restart the container.

4
Verify the container restarted
Run docker ps again to confirm the container webapp is running after the restart.
Docker
Need a hint?

Run docker ps to see running containers and confirm webapp is listed.