Q2. – What is the use of “docker wait” commands? with example and image

Limited Time Offer!

For Less Than the Cost of a Starbucks Coffee, Access All DevOpsSchool Videos on YouTube Unlimitedly.
Master DevOps, SRE, DevSecOps Skills!

Enroll Now

This command is used for waiting one or more containers to stop. We have to open 2 terminals. In one of them just put docker wait and in the other try to stop the same container. We can see the first terminal with docker wait is returned 0 and stopped waiting.

docker wait renamed1 [Terminal1]

docker stop renamed1 [Terminal2]