Docker Common Shell Collection

From: http://jamlee.cn/2015/03/22/docker%E4%B8%8E%E7%B2%BE%E5%BD%A9%E7%9A%84shell/

0x1: delete all images tagged with none

1
for i in `sudo docker images|grep \<none\>|awk '{print $3}'`;do sudo docker rmi $i;done

or

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

0x2: A simple way to change the source of Dockerfile

Ubuntu added:

RUN sed -i 's/http:\/\/archive\.ubuntu\.com\/ubuntu\//http:\/\/mirrors\.163\.com\/ubuntu\//g' /etc/apt/sources.list

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326696886&siteId=291194637
Recommended