網站伺服器切換回國內機房之後就是各種不適應,早上安裝 Docker,一直提示
Get:1 https://apt.dockerproject.org/repo ubuntu-xenial/main amd64 docker-engine amd64 1.11.2-0~xenial [14.5 MB]
Err:1 https://apt.dockerproject.org/repo ubuntu-xenial/main amd64 docker-engine amd64 1.11.2-0~xenial
Operation too slow. Less than 10 bytes/sec transferred the last 120 seconds
E: Failed to fetch https://apt.dockerproject.org/repo/pool/main/d/docker-engine/docker-engine\_1.11.2-0~xenial\_amd64.deb Operation too slow. Less than 10 bytes/sec transferred the last 120 seconds
E: Unable to fetch some archives, maybe run a-get update or try with --fix-missing?
調查後發現是因為 Docker 把相關文件放在了 Amazon S3 上,國內只能時好時不好。原因大家都懂
直接修改 "/etc/apt/apt.conf" 文件,配合 Shadowsocks 使用。
Acquire::http::proxy "http://127.0.0.1:1080/";
Acquire::ftp::proxy "ftp://127.0.0.1:1080/";
Acquire::https::proxy "https://127.0.0.1:1080/";
另外,apt-get 也有一個 "-o" 選項,直接跟 apt-get 的設置變量,就不用指定配置文件了,比如
sudo apt-get -o Acquire::http::proxy="http://127.0.0.1:1080/”
其他安裝方法 http://get.daocloud.io/#install-docker
參考 http://blog.csdn.net/sww\_simpcity/article/details/8776098