在mac下用docker build镜像时,报Failed to fetch

1.在mac上安装portia,https://github.com/scrapinghub/portia
git clone后使用docker build -t portia .
最后爆出错误

E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/p/python3-defaults/python3-dev_3.4.0-0ubuntu2_amd64.deb  Connection failed [IP: 91.189.91.24 80]

E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
Command failed (exitcode: 100), exiting...

是因为ubuntu的源要更改吗?

阅读 5.7k
1 个回答

这是因为在build的时候,从ubuntu官方源下载失败。

  • 可以多试几遍,说不定网络好的时候就成功了。

  • 或者把ubuntu的源改成国内的源:比如163的。注意这个需要修改Dockerfile里面的命令。

不过还是建议直接下载docker镜像
docker pull scrapinghub/portia-on-dash

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进