How do I remove an image in Docker

+1 vote

I have been running Docker using Vagrant under OS X 10.8.4 (Mountain Lion), and whenever I try to delete a saved image, I get an error:

$ docker rmi some-image-id
2013/07/15 hh:mm:ss unexpected JSON input

When I am using rmi help command it's showing, the proper syntax is docker rmi IMAGE [IMAGE...], and I'm not sure what to make of that.

How can I delete an image?

When I am running docker ps, no containers show up at all. Running docker images is showing four 4 base image and one 1 node image?

Can anyone help me with this query?

Thanks.

Sep 4, 2018 in Docker by shubham
• 7,340 points
949 views

2 answers to this question.

+1 vote

Here is what you can try. Use docker rmi node. That should work.

Seeing all created containers is as simple as 

docker ps -a.

To remove all existing containers (not images!) run 

docker rm $(docker ps -aq)
answered Sep 4, 2018 by Damon Salvatore
• 5,980 points
0 votes

Hi,

The following are some of the ways to remove docker images/containers:

  • Remove a single image.

$ docker rmi image_name:version/image-id
  • Remove all images.

$ docker rmi $(docker images -q)
answered Dec 23, 2020 by akhtar
• 38,260 points

Related Questions In Docker

0 votes
1 answer

how do I create an image from a tar archive in docker?

You can use docker load command inorder to get ...READ MORE

answered Jul 2, 2019 in Docker by Sirajul
• 59,230 points
8,529 views
0 votes
1 answer

How do I scale in Docker Swarm Mode W/Terraform Digital Ocean Load Balancing

The solution you could build for Digital ...READ MORE

answered Jun 19, 2018 in Docker by shubham
• 7,340 points
1,438 views
0 votes
1 answer
0 votes
1 answer
+2 votes
1 answer
+2 votes
1 answer

Deploy Docker Containers from Docker Cloud

To solve this problem, I followed advice ...READ MORE

answered Sep 3, 2018 in AWS by Priyaj
• 58,100 points
2,656 views
0 votes
2 answers

How do I force Docker for a clean build of an image ?

You could try this inorder to clean ...READ MORE

answered Aug 6, 2019 in Docker by Sirajul
• 59,230 points
10,592 views
0 votes
1 answer

How do I install phantomjs with node in docker

Here is what you can try. Link for existing ...READ MORE

answered Aug 1, 2018 in Docker by Damon Salvatore
• 5,980 points
5,695 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP