問題:使用docker 利用下載的ubuntu鏡像啓動容器時,使用的源下載更新軟件的速度較慢。
解決這個問題的方法是跟新ubuntu容器的源
示例:以ubuntu爲基礎鏡像
1)啓動一個名稱爲 test02的容器,並且開啓shell交互(/bin/bash )
# docker run -ti --name test02 ubuntu /bin/bash
2)用自帶vi修改源
root@e330db11c513:/# vi /etc/apt/sources.list
將原有內容刪除,並替換爲以下的阿里源
deb http://mirrors.aliyun.com/ubuntu/ trusty main multiverse restricted universe
deb http://mirrors.aliyun.com/ubuntu/ trusty-backports main multiverse restricted universe
deb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main multiverse restricted universe
deb http://mirrors.aliyun.com/ubuntu/ trusty-security main multiverse restricted universe
deb http://mirrors.aliyun.com/ubuntu/ trusty-updates main multiverse restricted universe
deb-src http://mirrors.aliyun.com/ubuntu/ trusty main multiverse restricted universe
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-backports main multiverse restricted universe
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-proposed main multiverse restricted universe
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-security main multiverse restricted universe
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-updates main multiverse restricted universe
3)更新源