之前很多次下载Github上的release文件都是失败,修改hosts文件、VPN走全局代理......尝试过N次都最终无果,今天boot2docker.iso下载时又遇到了这个问题,最后找到了一个比较不错的解决办法,在这里分享给大家~
具体原因参考:
办法一:pcloud网盘
将下载链接复制下来,然后转存到pcloud上,速度很快。
办法二:hosts文件
在hosts文件里添加该行,亲测有效。
54.231.98.184 github-com.s3.amazonaws.com
后面的内容不用看了,是Docker Toolbox安装时遇到的问题,顺便也记录一下。
λ docker-machine create --driver virtualbox default
Running pre-create checks...
(default) Default Boot2Docker ISO is out-of-date, downloading the latest release...
(default) Latest release for github.com/boot2docker/boot2docker is v18.05.0-ce
(default) Downloading C:\Users\ShawyerPeng\.docker\machine\cache\boot2docker.iso from https://github.com/boot2docker/boot2docker/releases/download/v18.05.0-ce/boot2docker.iso...
Error with pre-create check: "Get https://github-production-release-asset-2e65be.s3.amazonaws.com/14930729/5f8bfc34-5437-11e8-93cc-7bfa8f5fab4e?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20180529%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20180529T134536Z&X-Amz-Expires=300&X-Amz-Signature=c54f3f1f63c4b137e476d1b5716dc4362c4bebe1f8d179559d8a36e2ff720cf2&X-Amz-SignedHeaders=host&actor_id=0&response-content-disposition=attachment%3B%20filename%3Dboot2docker.iso&response-content-type=application%2Foctet-stream: dial tcp 127.0.0.1:443: connectex: No connection could be made because the target machine actively refused it."
解决方案:去github手动下载提示的版本,提示的版本,提示的版本,不是最新版本。
然后放在提示的 /Users/apple/.docker/machine/cache/目录中,记得一定要重启docker才会生效。