diff options
Diffstat (limited to 'devdocs/docker/engine%2Freference%2Fcommandline%2Frmi%2Findex.html')
| -rw-r--r-- | devdocs/docker/engine%2Freference%2Fcommandline%2Frmi%2Findex.html | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/devdocs/docker/engine%2Freference%2Fcommandline%2Frmi%2Findex.html b/devdocs/docker/engine%2Freference%2Fcommandline%2Frmi%2Findex.html new file mode 100644 index 00000000..042c8e7d --- /dev/null +++ b/devdocs/docker/engine%2Freference%2Fcommandline%2Frmi%2Findex.html @@ -0,0 +1,61 @@ +<h1>docker rmi</h1> <p><br></p> <p>Remove one or more images</p> <h2 id="usage">Usage</h2> <div class="highlight"><pre class="highlight" data-language="">$ docker rmi [OPTIONS] IMAGE [IMAGE...] +</pre></div> <p>Refer to the <a href="#options">options section</a> for an overview of available <a href="#options"><code class="language-plaintext highlighter-rouge">OPTIONS</code></a> for this command.</p> <h2 id="description">Description</h2> <p name="extended-description">Removes (and un-tags) one or more images from the host node. If an image has multiple tags, using this command with the tag as a parameter only removes the tag. If the tag is the only one for the image, both the image and the tag are removed.</p> <p>This does not remove images from a registry. You cannot remove an image of a running container unless you use the <code class="language-plaintext highlighter-rouge">-f</code> option. To see all images on a host use the <a href="../images/index"><code class="language-plaintext highlighter-rouge">docker image ls</code></a> command.</p> <p>For example uses of this command, refer to the <a href="#examples">examples section</a> below.</p> <h2 id="options">Options</h2> <table> <thead> <tr> <td>Name, shorthand</td> <td>Default</td> <td>Description</td> </tr> </thead> <tbody> <tr> <td> +<code class="language-plaintext highlighter-rouge">--force</code> , <code class="language-plaintext highlighter-rouge">-f</code> +</td> <td></td> <td>Force removal of the image</td> </tr> <tr> <td><code class="language-plaintext highlighter-rouge">--no-prune</code></td> <td></td> <td>Do not delete untagged parents</td> </tr> </tbody> </table> <h2 id="examples">Examples</h2> <p>You can remove an image using its short or long ID, its tag, or its digest. If an image has one or more tags referencing it, you must remove all of them before the image is removed. Digest references are removed automatically when an image is removed by tag.</p> <div class="highlight"><pre class="highlight" data-language="">$ docker images + +REPOSITORY TAG IMAGE ID CREATED SIZE +test1 latest fd484f19954f 23 seconds ago 7 B (virtual 4.964 MB) +test latest fd484f19954f 23 seconds ago 7 B (virtual 4.964 MB) +test2 latest fd484f19954f 23 seconds ago 7 B (virtual 4.964 MB) + +$ docker rmi fd484f19954f + +Error: Conflict, cannot delete image fd484f19954f because it is tagged in multiple repositories, use -f to force +2013/12/11 05:47:16 Error: failed to remove one or more images + +$ docker rmi test1:latest + +Untagged: test1:latest + +$ docker rmi test2:latest + +Untagged: test2:latest + + +$ docker images + +REPOSITORY TAG IMAGE ID CREATED SIZE +test latest fd484f19954f 23 seconds ago 7 B (virtual 4.964 MB) + +$ docker rmi test:latest + +Untagged: test:latest +Deleted: fd484f19954f4920da7ff372b5067f5b7ddb2fd3830cecd17b96ea9e286ba5b8 +</pre></div> <p>If you use the <code class="language-plaintext highlighter-rouge">-f</code> flag and specify the image’s short or long ID, then this command untags and removes all images that match the specified ID.</p> <div class="highlight"><pre class="highlight" data-language="">$ docker images + +REPOSITORY TAG IMAGE ID CREATED SIZE +test1 latest fd484f19954f 23 seconds ago 7 B (virtual 4.964 MB) +test latest fd484f19954f 23 seconds ago 7 B (virtual 4.964 MB) +test2 latest fd484f19954f 23 seconds ago 7 B (virtual 4.964 MB) + +$ docker rmi -f fd484f19954f + +Untagged: test1:latest +Untagged: test:latest +Untagged: test2:latest +Deleted: fd484f19954f4920da7ff372b5067f5b7ddb2fd3830cecd17b96ea9e286ba5b8 +</pre></div> <p>An image pulled by digest has no tag associated with it:</p> <div class="highlight"><pre class="highlight" data-language="">$ docker images --digests + +REPOSITORY TAG DIGEST IMAGE ID CREATED SIZE +localhost:5000/test/busybox <none> sha256:cbbf2f9a99b47fc460d422812b6a5adff7dfee951d8fa2e4a98caa0382cfbdbf 4986bf8c1536 9 weeks ago 2.43 MB +</pre></div> <p>To remove an image using its digest:</p> <div class="highlight"><pre class="highlight" data-language="">$ docker rmi localhost:5000/test/busybox@sha256:cbbf2f9a99b47fc460d422812b6a5adff7dfee951d8fa2e4a98caa0382cfbdbf +Untagged: localhost:5000/test/busybox@sha256:cbbf2f9a99b47fc460d422812b6a5adff7dfee951d8fa2e4a98caa0382cfbdbf +Deleted: 4986bf8c15363d1c5d15512d5266f8777bfba4974ac56e3270e7760f6f0a8125 +Deleted: ea13149945cb6b1e746bf28032f02e9b5a793523481a0a18645fc77ad53c4ea2 +Deleted: df7546f9f060a2268024c8a230d8639878585defcc1bc6f79d2728a13957871b +</pre></div> <div class="_attribution"> + <p class="_attribution-p"> + © 2019 Docker, Inc.<br>Licensed under the Apache License, Version 2.0.<br>Docker and the Docker logo are trademarks or registered trademarks of Docker, Inc. in the United States and/or other countries.<br>Docker, Inc. and other parties may also have trademark rights in other terms used herein.<br> + <a href="https://docs.docker.com/engine/reference/commandline/rmi/" class="_attribution-link">https://docs.docker.com/engine/reference/commandline/rmi/</a> + </p> +</div> |
