title: How can I remove all containers by image name and do nothing if it already removed
body: <p>I have bash script which stops and remove all docker container by image name.
  I can stop and remove all docker container by image name by single command</p>
  
  <pre><code>docker rm  $(docker stop $( docker ps -a -q --filter ancestor=image_name))
  </code></pre>
  
  <p>But if container not exist this expression <code>docker ps -a -q --filter ancestor=image_name</code> not returns nothing and <code>docker stop</code> command fails. How can I remove all containers by image name and do nothing if it already removed?</p>