docker技巧整理(不定期更新)

删除名称或者tag为none的镜像

$ docker images
<none>     <none>  9ccdd3df2456    2 hours ago         27MB
<none>     <none>  6802de6f74db    2 hours ago         27MB

$ docker images | grep '<none>' | awk '{print $3}' | xargs docker rmi

复制(备份)镜像

# 备份
$ docker save -o hello-world.tar hello-world:latest

# 删除
$ docker rmi hello-world:latest --force

# 恢复
$ docker load -i hello-world.tar

# 查看
$ docker images | grep hello-world

欢迎补充指正!

发布了231 篇原创文章 · 获赞 77 · 访问量 52万+

猜你喜欢

转载自blog.csdn.net/butterfly5211314/article/details/89028226