AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 690639
Accepted
Nathaniel Waisbrot
Nathaniel Waisbrot
Asked: 2015-05-09 07:12:18 +0800 CST2015-05-09 07:12:18 +0800 CST 2015-05-09 07:12:18 +0800 CST

Docker下的api-get“从服务器读取错误”

  • 772

我在 Bash 中运行以下命令:

DEBIAN_FRONTEND=noninteractive apt-get update -qq \
  && apt-get install -y build-essential git libncurses5-dev openssl \
     libssl-dev  fop xsltproc unixodbc-dev curl

它运行,但在中间失败:

Get:96 http://security.debian.org/ jessie/updates/main linux-libc-dev amd64 3.16.7-ckt9-3~deb8u1 [991 kB]
Get:97 http://security.debian.org/ jessie/updates/main curl amd64 7.38.0-4+deb8u2 [200 kB]
Get:98 http://security.debian.org/ jessie/updates/main openjdk-7-jre amd64 7u79-2.5.5-1~deb8u1 [176 kB]
Get:99 http://http.debian.net/debian/ jessie/main libgtk2.0-0 amd64 2.24.25-3 [2301 kB]
Err http://http.debian.net/debian/ jessie/main dpkg-dev all 1.17.25
  Error reading from server. Remote end closed connection [IP: 176.9.184.93 80]
Get:100 http://http.debian.net/debian/ jessie/main libatk-wrapper-java all 0.30.5-1 [30.3 kB]
Get:101 http://http.debian.net/debian/ jessie/main libatk-wrapper-java-jni amd64 0.30.5-1 [24.8 kB]
Get:102 http://http.debian.net/debian/ jessie/main libatomic1 amd64 4.9.2-10 [8992 B]
Get:103 http://http.debian.net/debian/ jessie/main libavahi-glib1 amd64 0.6.31-5 [36.4 kB]

因此整个操作失败并出现错误

E: Failed to fetch http://http.debian.net/debian/pool/main/d/dpkg/dpkg-dev_1.17.25_all.deb  Error reading from server. Remote end closed connection [IP: 176.9.184.93 80]

E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

我将其作为 Docker 构建的一部分运行。我的 Dockerfile 读取

FROM debian:jessie
RUN DEBIAN_FRONTEND=noninteractive  \
    apt-get update -qq \
    && apt-get install -y \
       build-essential \
       git \
       libncurses5-dev \
       openssl \
       libssl-dev \
       fop \
       xsltproc \
       unixodbc-dev \
       curl

我正在跑步docker build -t my-base:latest .

该apt-get命令有时会成功,有时会失败,而我没有进行任何更改。当我在本地开发机器上运行它时,它似乎总是成功,但当我在 EC2 机器上运行它时,它经常失败(但并非总是如此!)。此外,似乎在帮助apt-get update之前连续运行两次。apt-get install不过,我对最后两句话一点也不肯定。

任何想法可能会发生什么?apt-get 中是否有一些东西可以缓存时间戳,然后期望它是最新的?

debian
  • 1 1 个回答
  • 4777 Views

1 个回答

  • Voted
  1. Best Answer
    James Yale
    2015-05-09T09:04:56+08:002015-05-09T09:04:56+08:00

    这是您在使用 Docker 映像时会更频繁地看到的问题,因为您访问的存储库经常更改,但基础映像(以及缓存的元数据)不会。

    apt-get clean && apt-get update在安装软件包之前尝试运行。

    • 22

相关问题

  • 关闭 FTP

  • 如何在同一台电脑上从 putty 连接 debian vmware

  • debian- 文件到包的映射

  • Debian Ubuntu 网络管理器错误 [关闭]

  • 为本地网络中的名称解析添加自定义 dns 条目

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve