【问题标题】:Can't access internet from docker container无法从 docker 容器访问互联网
【发布时间】:2018-05-01 22:40:02
【问题描述】:

我在尝试从 docker 容器(使用 zotonic/zotonic-dev)运行 zotonic 时遇到此错误,看来我无法从容器连接到互联网。我已经尝试在My docker container has no internet 中使用解决方案,但似乎没有一个有效,或者我可能跳过了什么?

我使用 docker-compose run --service-ports zotonic sh 启动它

Building Zotonic for the first time.
EXOMETER_PACKAGES="-afunix -netlink -exo +setup" && ./rebar -C rebar.config.lock get-deps
WARN:  Missing plugins: [rebar_lock_deps_plugin]
==> zotonic (get-deps)
Pulling goldrush from {git,"git://github.com/DeadZen/goldrush.git",
                           "71e63212f12c25827e0c1b4198d37d5d018a7fec"}
Cloning into 'goldrush'...
fatal: Unable to look up github.com (port 9418) (Try again)
ERROR: sh(git clone -n git://github.com/DeadZen/goldrush.git goldrush)
failed with return code 128 and the following output:
Cloning into 'goldrush'...
fatal: Unable to look up github.com (port 9418) (Try again)

ERROR: 'get-deps' failed while processing /opt/zotonic: rebar_abort
make: *** [GNUmakefile:40: get-deps] Error 1
Erlang/OTP 20 [erts-9.0] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:10] [kernel-poll:true]

【问题讨论】:

  • 您使用了哪个 docker 镜像,您能否准确地添加到帖子中?是zotonic/zotonic还是别的什么?另外,您是否知道可以从内部连接到容器并进行调试,包括安装丢失的东西?命令是: docker exec -it "你的容器的 id" bash
  • 你在代理后面运行吗?
  • @isp-zax 我正在使用 zotonic/zotonic-dev 并使用docker-compose run --service-ports zotonic sh 运行它 | @yamenk 不,我没有使用任何代理
  • @AvicennaWisesa,我没有意识到您的 docker-compose 已经让您直接进入图像 bash。你可以尝试一些更简单的东西而不是运行 bin/zotonic 调试。例如,ping google.com 是否有效?如果不是,那么您是对的,并且互联网连接不存在。由于您可能已经重新启动了 docker 守护程序,我将尝试使用 curl (serverfault.com/questions/722466/…) 重新安装 docker,如果没有成功,则从映像内部调试 Internet 连接 (ubuntuforums.org/showthread.php?t=25557)。
  • @isp-zax 我重新安装了它,它可以工作了!谢谢

标签: ubuntu docker rebar zotonic


【解决方案1】:

虽然重新启动 docker 不起作用,但我像 @isp-zax 所说的那样通过 reinstalling docker using curl 解决了它。

【讨论】:

    猜你喜欢
    • 2016-02-20
    • 2020-10-18
    • 1970-01-01
    • 2014-07-11
    • 2021-09-23
    • 1970-01-01
    • 1970-01-01
    • 2021-01-26
    • 2020-12-16
    相关资源
    最近更新 更多