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

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]