Using ``docker stop CONTAINER`` followed by a ``docker rmi IMAGE`` where IMAGE is the image of CONTAINER may fail. To ensure that it won't fail, we have to wait for the disappearance of the container in the container list.