title: Docker image can't be deleted, "no such image"
body: <p>Okay, so I'm brand new to Docker and doing some tutorials and I want to delete the <code>nginx</code> and <code>mongo</code> images:</p>
  
  <pre><code>$ docker image ls
  REPOSITORY           TAG                 IMAGE ID            CREATED             SIZE
  nginx                latest              be1f31be9a87        12 days ago         109MB
  mongo                3.4                 598e8cf490a6        12 days ago         361MB
  </code></pre>
  
  <p>So I start with <code>nginx</code>:</p>
  
  <pre><code>$ docker image rm nginx
  Untagged: nginx:latest
  Untagged: nginx@sha256:9ad0746d8f2ea6df3a17ba89eca40b48c47066dfab55a75e08e2b70fc80d929e
  Deleted: sha256:be1f31be9a87cc4b8668e6f0fee4efd2b43e5d4f7734c75ac49432175aaa6ef9
  Deleted: sha256:7609c40a03b852382a43d79231d9d4ca7661cd1ac9edcb46f78a44fff4ed59ca
  Deleted: sha256:a2b6968c4326640dd5e9e22ddf6cebb61ba1a4b79a4ac8d194f93000c5a4c3e2
  Deleted: sha256:8b15606a9e3e430cb7ba739fde2fbb3734a19f8a59a825ffa877f9be49059817
  </code></pre>
  
  <p>Has it gone?</p>
  
  <pre><code>$ docker image ls
  REPOSITORY           TAG                 IMAGE ID            CREATED             SIZE
  mongo                3.4                 598e8cf490a6        12 days ago         361MB
  </code></pre>
  
  <p>So far so good. Now for <code>mongo</code>:</p>
  
  <pre><code>$ docker image rm mongo
  Error: No such image: mongo
  </code></pre>
  
  <p>Why didn't this work?</p>
  
  <p>In the end I found that <code>docker image rm 598e8cf490a6</code> did remove the <code>mongo</code> image, but I still don't understand why this didn't work.</p>
  
  <ul>
  <li>What is that first column, <code>REPOSITORY</code>? Is that the image name, or something else?</li>
  <li>If it is the image name, then why can't I delete the <code>mongo</code> image using <code>docker image rm mongo</code>?</li>
  <li>If it isn't the image name, then
  
  <ol>
  <li>What is it?</li>
  <li>Why does <code>docker image ls</code> show it instead of the image name?</li>
  <li>How do I get the actual image name? And specifically what is it? I also tried <code>docker image rm mongodb</code> and <code>docker image rm mongo-db</code> with no success.</li>
  </ol></li>
  </ul>