Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
299 views
in Technique[技术] by (71.8m points)

docker - 如何删除Docker中的图像?(How does one remove an image in Docker?)

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

(我在OS X 10.8.4(Mountain Lion)下在Vagrant下运行Docker,每当我尝试删除已保存的图像时,我都会收到错误消息:)

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

According to the rmi help, the proper syntax is docker rmi IMAGE [IMAGE...] , and I'm not sure what to make of that.

(根据rmi帮助,正确的语法是docker rmi IMAGE [IMAGE...] ,我不知道该怎么做。)

How can I delete an image?

(如何删除图像?)

$ docker version
Client version: 0.4.8
Server version: 0.4.8
Go version: go1.1

$docker info
Containers: 1
Images: 3

Interestingly, when I run docker ps , no containers show up at all.

(有趣的是,当我运行docker ps ,根本没有容器出现。)

Running docker images shows four (4) base images and one (1) node image.

(运行docker images显示四(4)个base图像和一(1)个node图像。)

  ask by Jules translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Try docker rmi node .

(尝试docker rmi node 。)

That should work.

(这应该工作。)

Seeing all created containers is as simple as docker ps -a .

(查看所有创建的容器就像docker ps -a一样简单。)

To remove all existing containers (not images!) run docker rm $(docker ps -aq)

(要删除所有现有容器(不是图像!),运行docker rm $(docker ps -aq))


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...