docker删掉所有容器_Docker:删除所有图像和容器

docker删掉所有容器

Docker

I've moved to a new project at Mozilla which uses a much different stack than I'm used to; suddenly I'm thrust into a world of Mercurial, Docker, and a few other technologies I'm not accustomed to.  You know what that leads to:  foul language, frustration, booze, and...lots of starting over.  Some hate starting over but wiping the slate clean provides me a bit of ease, knowing that I'm not compounding the problem by trying to patch a fix of a shim.

我已经移到Mozilla的一个新项目,该项目使用的堆栈与我以前使用的堆栈大不相同。 突然间,我进入了Mercurial,Docker和我不习惯的其他一些技术的世界。 您知道会导致什么:粗俗的语言,沮丧,饮酒和……许多重新开始。 有些讨厌从头开始,但将板岩擦干净让我有些轻松,因为我知道我不会通过尝试修补垫片来使问题复杂化。

Starting over in this case means wiping clean my Docker images and containers, just to make sure there are no conflicts or duplicates.  The following commands delete all containers and images:

在这种情况下,重新开始意味着清除我的Docker映像和容器,只是为了确保没有冲突或重复。 以下命令删除所有容器和图像:


# Delete every Docker containers
# Must be run first because images are attached to containers
docker rm -f $(docker ps -a -q)

# Delete every Docker image
docker rmi -f $(docker images -q)


Of course you don't want to do this if you're using Docker across multiple projects -- you'll find yourself in a world of hurt if you break your other images and containers.

当然,如果您在多个项目中使用Docker,则不希望这样做-如果您破坏其他映像和容器,将会感到非常痛苦。

There you have it -- a clean Docker slate in one pass!

一切就绪-一站式清洁Docker板岩!

翻译自: https://davidwalsh.name/docker-remove-all-images-containers

docker删掉所有容器

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值