gpt4 book ai didi

Docker 构建错误 : failed to add the host

转载 作者:行者123 更新时间:2023-12-02 18:21:16 24 4
gpt4 key购买 nike

我在运行 docker build 时遇到意外错误,我说意外,因为我没有改变我的Dockerfile有一段时间了,两周前最后一次运行良好,但现在我收到以下错误:

failed to create endpoint optimistic_spence on network bridge: failed to add the host (veth9fc3a03) <=> sandbox (veth15abfd6) pair interfaces: operation not supported



如果有任何帮助:
  • Docker 版本为 18.06.0-ce,构建 0ffa8257ec
  • 我没有看到任何带有 docker ps 的容器
  • Systemd 返回 docker 进程的事件状态 ( sudo systemctl status docker )
  • 构建命令是:docker build -t user/repo:tag .
  • Dockerfile好像:
    FROM alpine:3.4

    LABEL version="current version"
    LABEL description="A nice description."
    LABEL maintainer="my@email.com"

    RUN apk update && apk add \
    gcc \
    g++ \
    make \
    git \
    && git clone https://gitlab.com/user/repo.git \
    && cd repo \
    && make \
    && cp program /bin \
    && rm -r /repo \
    && apk del g++ make git

    WORKDIR /tmp

    ENTRYPOINT ["program"]

    有人明白发生了什么吗?谢谢!

    编辑
    --network 结合使用时选项,错误会稍微改变,但不会解决问题。例如, --network=host给出以下内容:

    fetch http://dl-cdn.alpinelinux.org/alpine/v3.4/main/x86_64/APKINDEX.tar.gz

    ERROR: http://dl-cdn.alpinelinux.org/alpine/v3.4/main: temporary error (try again later)

    WARNING: Ignoring APKINDEX.167438ca.tar.gz: No such file or directory

    fetch http://dl-cdn.alpinelinux.org/alpine/v3.4/community/x86_64/APKINDEX.tar.gz

    ERROR: http://dl-cdn.alpinelinux.org/alpine/v3.4/community: temporary error (try again later)

    WARNING: Ignoring APKINDEX.a2e6dac0.tar.gz: No such file or directory 2 errors; 11 distinct packages available

    The command '/bin/sh -c apk update && apk add gcc g++ make git && git clone https://gitlab.com/user/repo.git && cd repo && make && cp program /bin && rm -r /repo && apk del g++ make git' returned a non-zero code: 2

    最佳答案

    看起来任何 docker network bridge 都发生了问题它不允许您创建相同的内容,因为它是“僵尸”。

    请尝试以下步骤:

  • docker network prune ,如果它不起作用,请尝试:
  • docker system prune <-- 小心,这也会清除您命名的卷内容,即未分配给容器的卷。因此,如果将卷分配给容器,则必须重新构建/创建容器。
  • /etc/init.d/docker restart

  • 告诉我会发生什么,让我们看看,如果它不能解决你的问题,实际上我需要更多关于你的问题的信息。

    关于Docker 构建错误 : failed to add the host,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52059451/

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