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,320 points
142 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,170 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,050 points
2,172 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,320 points
512 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,120 points
1,145 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,050 points
7,118 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
2,484 views