阿裡雲的VPS,安裝的是鏡像市場中的Docker運行環境(Ubuntu 64位)系統,用docker pull鏡像的時候會報錯,具體錯誤如下:
Unable to find image ‘busybox’ locally
Pulling repository registry
2016/08/24 16:29:53 Could not reach any registry endpoint
docker version 查看到的信息如下:
Client version: 1.2.0
Client API version: 1.14
Go version (client): go1.3.1
Git commit (client): fa7b24f
OS/Arch (client): linux/amd64
Server version: 1.2.0
Server API version: 1.14
Go version (server): go1.3.1
Git commit (server): fa7b24f
針對此錯誤的解決方法如下:
1,需要升級docker,具體命令如下:
sudo apt-get install docker.io
2,不過阿裡的這個鏡像源有點問題,升級的時候部分源是404,會報錯。需要修改/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,apt-get clean && apt-get update
4,然後繼續sudo apt-get install docker.io
升級完成之後就可以成功解決前文中提到的錯誤。