ITPub博客

首页 > Linux操作系统 > Linux操作系统 > docker删除所有容器和镜像命令

docker删除所有容器和镜像命令

原创 Linux操作系统 作者:chenfeng 时间:2019-09-25 10:03:06 0 删除 编辑

删除容器需要先停止后remove:

# docker stop $(docker ps -a -q)

a679aa25d419

d6f061600581

a1fc78352ff1

fdb3718b8ad1

3488a417dcf0

ada453d6f211

842701cc68df

671452b1a499

.........................................

.........................................

.........................................


# docker  rm $(docker ps -a -q)

a679aa25d419

d6f061600581

a1fc78352ff1

fdb3718b8ad1

3488a417dcf0

ada453d6f211

842701cc68df

671452b1a499

.........................................

.........................................

.........................................



删除镜像:

# docker rmi $(docker images -q)

Untagged: docker.io/pingcap/tidb:latest

Untagged: docker.io/pingcap/tidb@sha256:ac88129dd374cde1c24257fe77c58b0d1bb24bdd54a537c92366921ae0d6cbe0

Deleted: sha256:a7675eab8c2f45fe907aaf396371eb94d6ab7720666aa45c1d0d9999906e8e6c

Deleted: sha256:e18236727dad9eb87671dab4d976848fa39839375210d31e89ce74216a6420c3

Untagged: docker.io/pingcap/pd:latest

Untagged: docker.io/pingcap/pd@sha256:767af19c79f3d1db450a2c6a062f0d1ea8dfc3276bb06efdb569c8d0df31b23b

Deleted: sha256:1028ef8a9e6953fb4ad5b3bbc0fed1d41bc439bce7e06ef5d3bdcd0a04e9b370

Deleted: sha256:d90e59bf820b49f5d9f3f6c3c84daff3ea940bd3017a6579493d498954025323

Deleted: sha256:a49f7990bbb7c9dcfabae2c4765bba51b4032f41916070496bf847bee5ab3fd4

......................................... ......................................... ......................................... ......................................... ......................................... .....................

......................................... ......................................... ......................................... ......................................... ......................................... .....................


来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/15498/viewspace-2658147/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
交流MySQL,MongoDB和Redis技术。 微信或QQ:410294

注册时间:2015-12-07

  • 博文量
    754
  • 访问量
    2126627