title: Why the "none" image appears in Docker and how can we avoid it
body: <p>When I run the <code>docker-compose build</code> command to rebuild an image in Docker because I had changed something in Dockerfile, sometimes I get "none" image tags. How can we avoid this fact? I want to rebuild the image but the <em>none</em> image should not appear.</p>
  
  <pre><code>REPOSITORY  TAG            IMAGE ID            CREATED             SIZE
  magento2    latest         b4dce4dcbd4f        16 hours ago        516MB
  &lt;none&gt;      &lt;none&gt;         b4ffce2bf91e        16 hours ago        519MB
  &lt;none&gt;      &lt;none&gt;         a1aedb60c82a        17 hours ago        516MB
  &lt;none&gt;      &lt;none&gt;         ec9a14ae856c        20 hours ago        519MB
  &lt;none&gt;      &lt;none&gt;         ef8eba6874cc        23 hours ago        516MB
  &lt;none&gt;      &lt;none&gt;         0e53a8b8c303        23 hours ago        516MB
  php         7.1-apache     93e6fb4b13e1        3 weeks ago         369MB
  mysql       5.6.39         079344ce5ebd        7 months ago        256MB
  </code></pre>