Make checking of running container optional.
Merge pull request #12558 from ticosax/check-is-running-container-optional

Make checking of running container optional.