从Dockerfile构建映像时无法连接debian prod

rqdpfwrv  于 2022-12-18  发布在  Docker
关注(0)|答案(2)|浏览(568)

我尝试复制此项目https://github.com/tabulapdf/tabula.git,此项目中存在dockerfile。我尝试从dockerfile构建映像,但在构建映像时出现错误,提示“无法连接到deb.debian.org:http:“
我试着在stackoverflow中搜索相关问题,但没有得到任何明确的想法如何解决这个问题。

FROM jruby:9.1-jdk

RUN apt-get update -qq && apt-get install -y build-essential
RUN echo 'gem: --no-rdoc --no-ri' >> /.gemrc

ENV GEM_HOME /usr/local/bundle
ENV PATH $GEM_HOME/bin:$PATH
RUN gem install bundler -v '< 2' \
  && bundle config --global path "$GEM_HOME" \
  && bundle config --global bin "$GEM_HOME/bin"

这是我得到的错误,而建立的形象:

Step 1/17 : FROM jruby:9.1-jdk
 ---> 0de61e330d81
Step 2/17 : RUN apt-get update  && apt-get install -y apt-transport-https && apt-get install -y build-essential
 ---> Running in 5819127c82e0
Err:1 http://deb.debian.org/debian stretch InRelease
  Could not connect to prod.debian.map.fastly.net:80 (151.101.200.204). - connect (111: Connection refused) Could not connect to deb.debian.org:80 (130.89.148.77). - connect (111: Connection refused) [IP: 130.89.148.77 80]
Err:2 http://deb.debian.org/debian stretch-updates InRelease
  Unable to connect to deb.debian.org:http: [IP: 130.89.148.77 80]
Err:3 http://security.debian.org/debian-security stretch/updates InRelease
  Could not connect to prod.debian.map.fastly.net:80 (151.101.200.204). - connect (111: Connection refused) Could not connect to security.debian.org:80 (128.31.0.63). - connect (111: Connection refused) [IP: 128.31.0.63 80]
Reading package lists...
W: Failed to fetch http://deb.debian.org/debian/dists/stretch/InRelease  Could not connect to prod.debian.map.fastly.net:80 (151.101.200.204). - connect (111: Connection refused) Could not connect to deb.debian.org:80 (130.89.148.77). - connect (111: Connection refused) [IP: 130.89.148.77 80]
W: Failed to fetch http://security.debian.org/debian-security/dists/stretch/updates/InRelease  Could not connect to prod.debian.map.fastly.net:80 (151.101.200.204). - connect (111: Connection refused) Could not connect to security.debian.org:80 (128.31.0.63). - connect (111: Connection refused) [IP: 128.31.0.63 80]
W: Failed to fetch http://deb.debian.org/debian/dists/stretch-updates/InRelease  Unable to connect to deb.debian.org:http: [IP: 130.89.148.77 80]
W: Some index files failed to download. They have been ignored, or old ones used instead.
Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package apt-transport-https
ERROR: Service 'web' failed to build: The command '/bin/sh -c apt-get update  && apt-get install -y apt-transport-https && apt-get install -y build-essential' returned a non-zero code: 100
qlfbtfca

qlfbtfca1#

您必须将代理参数包含到Dockerfile中:
ENV http_代理
ENV https_代理

ldfqzlk8

ldfqzlk82#

如果您正在通过VPN工作,请尝试断开连接。

相关问题