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

Block until one or more containers stop, after that it print their exit codes.
root@ip-172-31-28-155:/home/ubuntu# docker wait test_httpd

root@ip-172-31-28-155:/home/ubuntu# docker stop test_httpd
test_httpd

root@ip-172-31-28-155:/home/ubuntu# docker wait test_httpd
0