首页 > 其他 > 详细

docker 整理

时间:2019-08-17 22:55:42      阅读:83      评论:0      收藏:0      [点我收藏+]

1、删除所有容器

docker rm `docker ps -a -q`

2、删除所有镜像

docker rmi `docker images -q`

3、按条件删除镜像

  没有打标签

docker rmi `docker images -q | awk ‘/^<none>/ { print $3 }‘`

  镜像名包含关键字

docker rmi --force `docker images | grep doss-api | awk ‘{print $3}‘`    //其中doss-api为关键字


3、apt-get 加速脚本

#!/bin/bash
mv /etc/apt/sources.list /etc/apt/sources.list.bak
Codename=$( (lsb_release -a)|awk ‘{print $2}‘|tail -n 1 )

echo "\

#deb-src http://archive.ubuntu.com/ubuntu xenial main restricted #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted multiverse universe #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted multiverse universe #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates universe
deb http://mirrors.aliyun.com/ubuntu/ xenial multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse #Added by software-properties
deb http://archive.canonical.com/ubuntu xenial partner
deb-src http://archive.canonical.com/ubuntu xenial partner
deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted multiverse universe #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial-security universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-security multiverse ">/etc/apt/sources.list


apt-get update


~
~
~

docker 整理

原文:https://www.cnblogs.com/xiaoxuebiye/p/11370427.html

(0)
(0)
   
举报
评论 一句话评论(0
分享档案
最新文章
教程昨日排行
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!