Docker Containers
20%
Restarting Containers
Managing the lifecycle of containers often involves restarting them. You can restart a container using the docker restart command. Here is an example:
# Create and run an Nginx container
docker run -d --name my_nginx nginx
You should see a long alphanumeric string as the output:
Example:
5a9c835bb0ba1c3e3f61d351f7899622af51d169f4367c7dd65d58c04746366b
This is the long ID of the container. You can use the first one, two, or more characters of this ID to reference the container (as long as it is unique). For example:
Painless Docker - 2nd Edition
A Comprehensive Guide to Mastering Docker and its EcosystemEnroll now to unlock all content and receive all future updates for free.
Unlock now  $31.99$25.59Learn More
Hurry! This limited time offer ends in:
To redeem this offer, copy the coupon code below and apply it at checkout:
