gpt4 book ai didi

dockerfile - wget : unable to resolve host address 'github.com'

转载 作者:行者123 更新时间:2023-12-05 02:04:48 26 4
gpt4 key购买 nike

我正在使用 Redhat UBI 图像构建我的 dockerfile,当我构建图像时,我得到了 wget:无法解析主机地址'github.com'。

我已尝试添加一个不以 GitHub 开头的不同 URL,但该 URL 有效。不确定是什么问题。

下面是我在构建 docker 文件时得到的错误日志:wget: unable to resolve host address 'github.com'

Step 11/25 : RUN set -ex;   apk update;   apk add -f acl dirmngr gpg lsof procps wget netcat gosu tini;   rm -rf /var/lib/apt/lists/*;   cd /usr/local/bin; wget -nv https://github.com/apangin/jattach/releases/download/v1.5/jattach; chmod 755 jattach;   echo >jattach.sha512 "d8eedbb3e192a8596c08efedff99b9acf1075331e1747107c07cdb1718db2abe259ef168109e46bd4cf80d47d43028ff469f95e6ddcbdda4d7ffa73a20e852f9  jattach";   sha512sum -c jattach.sha512; rm jattach.sha512
---> Running in 3ad58c40b25a
+ apk update
fetch https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz
v20200917-1125-g7274a98dfc [https://dl-cdn.alpinelinux.org/alpine/edge/main]
v20200917-1124-g01e8cb93ff [https://dl-cdn.alpinelinux.org/alpine/edge/community]
OK: 13174 distinct packages available
+ apk add -f acl dirmngr gpg lsof procps wget netcat gosu tini
(1/12) Installing libacl (2.2.53-r0)
(2/12) Installing acl (2.2.53-r0)
(3/12) Installing lsof (4.93.2-r0)
(4/12) Installing libintl (0.20.2-r0)
(5/12) Installing ncurses-terminfo-base (6.2_p20200918-r1)
(6/12) Installing ncurses-libs (6.2_p20200918-r1)
(7/12) Installing libproc (3.3.16-r0)
(8/12) Installing procps (3.3.16-r0)
(9/12) Installing tini (0.19.0-r0)
(10/12) Installing libunistring (0.9.10-r0)
(11/12) Installing libidn2 (2.3.0-r0)
(12/12) Installing wget (1.20.3-r1)
Executing busybox-1.32.0-r3.trigger
OK: 9 MiB in 26 packages
+ rm -rf '/var/lib/apt/lists/*'
+ cd /usr/local/bin
+ wget -nv https://github.com/apangin/jattach/releases/download/v1.5/jattach
wget: unable to resolve host address 'github.com'
The command '/bin/sh -c set -ex; apk update; apk add -f acl dirmngr gpg lsof procps wget netcat gosu tini; rm -rf /var/lib/apt/lists/*; cd /usr/local/bin; wget -nv https://github.com/apangin/jattach/releases/download/v1.5/jattach; chmod 755 jattach; echo >jattach.sha512 "d8eedbb3e192a8596c08efedff99b9acf1075331e1747107c07cdb1718db2abe259ef168109e46bd4cf80d47d43028ff469f95e6ddcbdda4d7ffa73a20e852f9 jattach"; sha512sum -c jattach.sha512; rm jattach.sha512' returned a non-zero code: 4

这是我为创建图像而构建的 docker 文件

FROM alpine: edge as BUILD


LABEL maintainer="Project Ranger team <mbyousaf@deloitte.co.uk>"
LABEL repository="https://github.com/docker-solr/docker-solr"

ARG SOLR_VERSION="8.6.2"
ARG SOLR_SHA512="0a43401ecf7946b2724da2d43896cd505386a8f9b07ddc60256cb586873e7e58610d2c34b1cf797323bf06c7613b109527a15105dc2a11be6f866531a1f2cef6"
ARG SOLR_KEYS="E58A6F4D5B2B48AC66D5E53BD4F181881A42F9E6"
# If specified, this will override SOLR_DOWNLOAD_SERVER and all ASF mirrors. Typically used downstream for custom builds
ARG SOLR_DOWNLOAD_URL

# Override the solr download location with e.g.:
# docker build -t mine --build-arg SOLR_DOWNLOAD_SERVER=http://www-eu.apache.org/dist/lucene/solr .
ARG SOLR_DOWNLOAD_SERVER


RUN set -ex; \
apk add --update; \
apk add -f install acl dirmngr gpg lsof procps wget netcat gosu tini; \
rm -rf /var/lib/apt/lists/*; \
cd /usr/local/bin; wget -nv https://github.com/apangin/jattach/releases/download/v1.5/jattach; chmod 755 jattach; \
echo >jattach.sha512 "d8eedbb3e192a8596c08efedff99b9acf1075331e1747107c07cdb1718db2abe259ef168109e46bd4cf80d47d43028ff469f95e6ddcbdda4d7ffa73a20e852f9 jattach"; \
sha512sum -c jattach.sha512; rm jattach.sha512

最佳答案

我会检查你是否可以在你正在构建的主机上解析 github.com,我会 cat/etc/resolv.conf 查看你主机的解析器。如果 github.com 在您的主机上解析(您可以通过 nslookup github.com 查看),那么我会尝试通过配置 Docker 守护进程来显式使用解析器,如所见 herehere或者我会尝试按照答案 here 中的建议在每个命令级别执行此操作,这是一种创意。

RUN echo "nameserver XX.XX.XX.XX" > /etc/resolv.conf && \    
command_depending_on_dns_resolution

关于dockerfile - wget : unable to resolve host address 'github.com' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64050339/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com