构建Docker映像时无法找到包

裁员

在Docker容器构建过程中,我尝试使用apt-get install安装一些软件包。但是,该过程无法完成,因为找不到4个软件包中的3个。

Step 1 : RUN apt-get update  && apt-get install -y netcat  ca-certificates  build-essential  libssl-dev
 ---> Running in 38d22d97ec4a
Err http://http.debian.net jessie InRelease

Err http://http.debian.net jessie-updates InRelease

Err http://security.debian.org jessie/updates InRelease

Err http://http.debian.net jessie Release.gpg
  Could not resolve 'http.debian.net'
Err http://security.debian.org jessie/updates Release.gpg
  Could not resolve 'security.debian.org'
Err http://http.debian.net jessie-updates Release.gpg
  Could not resolve 'http.debian.net'
Reading package lists...
W: Failed to fetch http://http.debian.net/debian/dists/jessie/InRelease

W: Failed to fetch http://http.debian.net/debian/dists/jessie-updates/InRelease 

W: Failed to fetch http://security.debian.org/dists/jessie/updates/InRelease

W: Failed to fetch http://http.debian.net/debian/dists/jessie/Release.gpg  Could not resolve 'http.debian.net'

W: Failed to fetch http://http.debian.net/debian/dists/jessie-updates/Release.gpg  Could not resolve 'http.debian.net'

W: Failed to fetch http://security.debian.org/dists/jessie/updates/Release.gpg  Could not resolve 'security.debian.org'

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 netcat
E: Unable to locate package build-essential
E: Unable to locate package libssl-dev
Removing intermediate container 38d22d97ec4a
2015/08/10 12:03:07 The command [/bin/sh -c apt-get update  && apt-get install -y netcat  ca-certificates  build-essential  libssl-dev] returned a non-zero code: 100

起初,我以为这是我的基本映像的问题,但是在其他VM上构建容器没有问题。有什么想法吗?

裁员

此问题与主机的网络配置有关。eth0接口配置错误。以下命令帮助我确定这是DNS问题。

$ docker run --rm debian:jessie ping -c 5 google.com
ping: unknown host
$ docker run --rm debian:jessie ping -c 5 8.8.8.8
PING 8.8.8.8 (8.8.8.8): 56 data bytes
64 bytes from 8.8.8.8: icmp_seq=0 ttl=38 time=37.147 ms
64 bytes from 8.8.8.8: icmp_seq=1 ttl=38 time=32.917 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=38 time=31.475 ms
64 bytes from 8.8.8.8: icmp_seq=3 ttl=38 time=30.692 ms
64 bytes from 8.8.8.8: icmp_seq=4 ttl=38 time=31.180 ms
--- 8.8.8.8 ping statistics ---
5 packets transmitted, 5 packets received, 0% packet loss
round-trip min/avg/max/stddev = 30.692/32.682/37.147/2.352 ms

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

构建Docker映像时无法安装sklearn

构建映像时无法运行docker

Docker在构建映像时无法删除文件

在 docker 构建期间无法找到 Ubuntu 包

构建后无法找到我的Docker映像

使用Dockerfile构建Docker映像时无法更改目录

构建Docker映像时无法使用私钥进行SSH

构建Docker映像时npm无法安装依赖项

构建Docker映像时的InsecurePlatformWarning

无法在本地找到Docker映像

Docker 构建映像失败?无法计算缓存键:“/app”未找到:未找到

如何找到Docker映像的构建时间?

构建Docker映像时Go构建失败

无法在Python映像上找到包msodbcsql

为Python项目构建Docker映像时如何避免重新安装软件包?

基于Logstash构建Docker映像时,权限被拒绝安装软件包

使用Jenkins管道构建Docker映像时如何解决“无法从Docker检索.Id”

Kubernetes无法在本地运行Docker映像构建

无法使用 gradlew 命令构建 Docker 映像

无法在Windows 10上构建Docker映像

构建jenkins docker映像时出错

Docker在构建映像时找不到文件

构建Docker映像时参考格式无效

构建Docker映像时复制异常

Docker-尝试构建映像时出现“无法在该平台上使用映像操作系统“ linux”

使用Gradle任务构建映像时无法在Docker容器内设置环境变量

错误:无法准备上下文:在构建和标记Docker映像时找不到路径“”

尝试运行Docker映像时,Google Cloud无法找到默认凭据

Travis构建无法找到包lldb; 3.1