問題:使用docker 利用下載的ubuntu鏡像啟動容器時,使用的源下載更新軟件的速度較慢。
解決這個問題的方法是跟新ubuntu容器的源
示例:以ubuntu為基礎鏡像
啟動一個名稱為 test02的容器,並且開啟shell交互(/bin/bash )
docker run -ti --name test02 ubuntu /bin/bash
用自帶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
更新源
sudo apt-get clean
sudo apt-get update
安裝vim
apt-get install vim