gpt4 book ai didi

linux - Docker 错误 : Could not connect to deb. debian.org(111:连接被拒绝)

转载 作者:行者123 更新时间:2023-12-04 16:38:41 32 4
gpt4 key购买 nike

关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。












我们不允许在 Stack Overflow 上提出有关通用计算硬件和软件的问题。您可以编辑问题,使其成为 on-topic对于堆栈溢出。


3个月前关闭。







Improve this question




我在 Windows 10 上使用 Docker 创建 Debian 镜像。但是,我认为 Docker Desktop、Dockerfile 或 Docker 命令有问题。
Docker 桌面 ,我对默认配置做了三处更改。

  • 在General下我打开了Expose daemon on tcp://localhost:2375 without TLS .
  • 在资源 > 代理下,我有 httphttps配置。
  • 在 WSL 集成下,我打开了 Ubuntu 18.04。

  • Dockerfile 导致问题如下:
    FROM debian:buster-slim

    ENV LANG=C.UTF-8 LC_ALL=C.UTF-8

    RUN apt-get update --fix-missing && \
    apt-get install -y wget && \
    apt-get clean

    CMD [ "/bin/bash" ]
    如果它有帮助,这个替代 Dockerfile 运行没有问题:
    FROM debian:buster-slim

    ENV LANG=C.UTF-8 LC_ALL=C.UTF-8

    RUN apt-get update --fix-missing && \
    apt-get clean

    CMD [ "/bin/bash" ]
    docker 命令我用来构建的Dockerfile如下:
    >>> docker build simple-example
    注: Dockerfile是目录 simple-example 中的唯一文件.
    正在尝试构建 Dockerfile docker 命令鉴于 Docker 桌面 配置导致以下错误:
    (base) C:\Users\usr1\Docker>docker build simple-example
    [+] Building 25.4s (5/5) FINISHED
    => [internal] load build definition from Dockerfile 0.0s
    => => transferring dockerfile: 32B 0.0s
    => [internal] load .dockerignore 0.0s
    => => transferring context: 2B 0.0s
    => [internal] load metadata for docker.io/library/debian:buster-slim 2.9s
    => CACHED [1/2] FROM docker.io/library/debian:buster-slim@sha256:240f770008bdc538fecc8d3fa7a32a533eac55c14cbc56a9a8a6f7d741b47e33 0.0s
    => ERROR [2/2] RUN apt-get update --fix-missing && apt-get install -y wget && apt-get clean 22.4s
    ------
    > [2/2] RUN apt-get update --fix-missing && apt-get install -y wget && apt-get clean:
    #5 21.80 Err:1 http://deb.debian.org/debian buster InRelease
    #5 21.80 Could not connect to deb.debian.org:80 (151.101.54.132). - connect (111: Connection refused) Could not connect to deb.debian.org:80 (151.101.54.132). - connect (111: Connection refused)
    #5 21.80 Err:2 http://deb.debian.org/debian buster-updates InRelease
    #5 21.80 Unable to connect to deb.debian.org:http:
    #5 22.28 Err:3 http://security.debian.org/debian-security buster/updates InRelease
    #5 22.28 Could not connect to security.debian.org:80 (151.101.0.204). - connect (111: Connection refused) Could not connect to security.debian.org:80 (151.101.64.204). - connect (111: Connection refused) Could not connect to security.debian.org:80 (151.101.128.204). - connect (111: Connection refused) Could not connect to security.debian.org:80 (151.101.192.204). - connect (111: Connection refused)
    #5 22.29 Reading package lists...
    #5 22.32 W: Failed to fetch http://deb.debian.org/debian/dists/buster/InRelease Could not connect to deb.debian.org:80 (151.101.54.132). - connect (111: Connection refused) Could not connect to deb.debian.org:80 (151.101.54.132). - connect (111: Connection refused)
    #5 22.32 W: Failed to fetch http://security.debian.org/debian-security/dists/buster/updates/InRelease Could not connect to security.debian.org:80 (151.101.0.204). - connect (111: Connection refused) Could not connect to security.debian.org:80 (151.101.64.204). - connect (111: Connection refused) Could not connect to security.debian.org:80 (151.101.128.204). - connect (111: Connection refused) Could not connect to security.debian.org:80 (151.101.192.204). - connect (111: Connection refused)
    #5 22.32 W: Failed to fetch http://deb.debian.org/debian/dists/buster-updates/InRelease Unable to connect to deb.debian.org:http:
    #5 22.32 W: Some index files failed to download. They have been ignored, or old ones used instead.
    #5 22.34 Reading package lists...
    #5 22.35 Building dependency tree...
    #5 22.35 Reading state information...
    #5 22.35 E: Unable to locate package wget
    ------
    executor failed running [/bin/sh -c apt-get update --fix-missing && apt-get install -y wget && apt-get clean]: exit code: 100
    这三个(Docker Desktop、Dockerfile 或 Docker 命令)中的哪一个会导致此错误?我应该怎么做才能修复它?

    最佳答案

    尝试将这两行放在 Dockerfile 中:

    ENV http_proxy=http:...
    ENV https_proxy=http:...

    关于linux - Docker 错误 : Could not connect to deb. debian.org(111:连接被拒绝),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65297987/

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