【问题标题】:wget: unable to resolve host address 'github.com' inside alpine docker imagewget:无法解析 alpine docker 映像中的主机地址“github.com”
【发布时间】:2021-02-09 08:07:44
【问题描述】:
/ # wget -O - https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/${HUGO_ID}
_Linux-64bit.tar.gz
--2021-02-09 08:03:32--  https://github.com/gohugoio/hugo/releases/download/v0.76.5/hugo_extended_0.76.5_Linux-64bit.tar.gz
Resolving github.com (github.com)... failed: Name does not resolve.

在 alpine 内部,我无法解析 github.com。我检查了 /etc/hosts 并没有发现任何问题。然而,像 google.com 这样的其他网站确实可以解决。

【问题讨论】:

    标签: docker dns alpine


    【解决方案1】:

    wget 需要在 ipv4 上。

    wget -4 -O - https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/${HUGO_
    ID}_Linux-64bit.tar.gz
    

    【讨论】:

    • 这个-4 选项是什么? wget 没有任何这样的选项..这个命令对你有用吗?
    猜你喜欢
    • 2021-01-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-02-27
    • 1970-01-01
    • 1970-01-01
    • 2019-09-03
    • 2016-02-13
    相关资源
    最近更新 更多