10

I'm new on the containers world and I recently have started with Docker. But I'm having some issues, and I couldn't find a solution ( at least one I understand minimally). So, here's the problem:

  • I want to delete a local image tag ("repository"/"tag" combination). Is it possible?
  • How can I, having multiple TAGs associated with just one image ID, delete any of these TAGs without deleting the others? In my case, I just wanna to exclude the hiworld repository. I'm able to delete the image and therefore all the TAGs associated with, but this is not what I want to do. Below is what is displayed when I enter the command docker images.
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
helloworld1         latest              8916c2510f76        3 hours ago         148MB
hiworld             latest              8916c2510f76        3 hours ago         148MB

Thanks in advance.

2
  • 1
    Instead of linking to a picture of a few lines of text, just include the actual text here in your question.
    – larsks
    Jan 31, 2018 at 21:06
  • 1
    okok, will do this Jan 31, 2018 at 22:55

1 Answer 1

20

docker rmi (the remove image command) does this.

$ docker rmi hiworld:latest

That will untag hiworld:latest, but will leave helloworld1:latest (and 8916c2510f76) in place. According to the docs,

If an image has one or more tags referencing it, you must remove all of them before the image is removed.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.