title: Docker - accidently commited without specifying an image, generating a new one. How to update the old image instead?
body: <p>After doing extensive work on a very large image I accidently ran <code>docker commit CONTAINER_ID</code> instead of <code>docker commit CONTAINER_ID IMAGE</code>. My intention was to update the old image with the new work, but now I have two very large images instead:</p>
  <pre><code>$ docker images
  REPOSITORY                 TAG             IMAGE ID       CREATED          SIZE
  &lt;none&gt;                     &lt;none&gt;          78aebb8ed5af   35 minutes ago   88.6GB
  my-ubuntu                  latest          a153f4458b1a   14 hours ago     28.8GB
  </code></pre>
  <p>How can I fix this, that is, have only a single image <code>my-ubuntu</code> with the changes currently present only in the new image?</p>
  <p>I tried <code>docker image rm my-ubuntu</code> to keep only the new image which is more up to date, but this gives:</p>
  <pre><code>Error response from daemon: conflict: unable to delete my-ubuntu (cannot be forced) - image has dependent child images
  </code></pre>
  <p>I suppose that's because the new image was built from <code>my-ubuntu</code>, but... I do not wish to delete the new image and re-do all the work and commit again. Is there any way this can be avoided?</p>
  <p><a href="https://stackoverflow.com/a/38119847/2032568">This answer</a> suggests deleting dangling images, but <code>docker images --filter &quot;dangling=true&quot;</code> returns precisely the new image which I do not want to delete. <a href="https://stackoverflow.com/a/39713151/2032568">This answer</a> suggests creating a docker file from both images and generating a new image, but the output of that command for the new image is the same as for <code>my-ubuntu</code> except a new sha256 entry with the work done on the new image, so should I just create a dockerfile from it and then an imagem from the dockerfile? I'm new to docker and unsure how to proceed.</p>