Docker Restart Container

DockerDockerBeginner
Practice Now

Introduction

In this lab, we will explore the concept of restarting Docker containers in a whimsical wonderland setting. Our story unfolds in a magical land, guarded by the enchanting Fairy Queen. The denizens of this realm depend on Docker containers to maintain the harmony of their world. However, a mysterious disruption has caused chaos, and only by learning the art of restarting containers can the Fairy Queen restore peace to her realm.


Skills Graph

%%%%{init: {'theme':'neutral'}}%%%% flowchart RL docker(("`Docker`")) -.-> docker/ContainerOperationsGroup(["`Container Operations`"]) docker/ContainerOperationsGroup -.-> docker/restart("`Restart Container`") subgraph Lab Skills docker/restart -.-> lab-271489{{"`Docker Restart Container`"}} end

Starting the Journey

In this step, we will begin our journey by launching a Docker container using the 'hello-world' image. Follow the commands below to embark on our adventure.

docker run --name hello-world hello-world

Exploring the Realm

We will now delve into our Docker realm further by launching an 'alpine' container and gaining access to its command line.

docker run -it --name myalpine alpine sh

The Quest for Nginx

In this step, we will summon the mighty 'nginx' container to our wonderland and set it on a noble quest to serve web pages.

docker run -d -p 80:80 --name nginx-container nginx

Embracing Chaos

Our realm is now plagued by chaos, and the Fairy Queen calls upon us to restart the 'nginx' container to restore peace.

docker restart nginx-container

Summary

In this lab, we embarked on a journey through a whimsical wonderland, using Docker to restore order to a realm in chaos. By mastering the art of restarting Docker containers, we empowered ourselves to bring harmony back to the land and gained valuable insights into the vital role of container management.

Other Docker Tutorials you may like