首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法更新Docker中的Debian容器

无法更新Docker中的Debian容器
EN

Stack Overflow用户
提问于 2019-07-11 21:08:47
回答 2查看 606关注 0票数 2

运行Docker for Windows 18.09.2与Docker Desktop 2.0.0.3 *31259,尝试通过apt-get更新更新Debian容器。

代码语言:javascript
复制
First I pull the latest images:
    > docker pull debian
Using default tag: latest
latest: Pulling from library/debian
5ae19949497e: Pull complete
Digest: sha256:903779f30a7ee46937bfb21406f125d5fdace4178074e1cc71c49039ebf7f48f
Status: Downloaded newer image for debian:latest
> docker run -d -ti --name d1 debian
d1fce4047033d6321740f98315b2ec050ca946c835625927065d413f21fd216d
> docker ps
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES
d1fce4047033        debian              "bash"              2 seconds ago       Up 1 second                             d1

然后我连接到容器并尝试进行更新:

代码语言:javascript
复制
$ winpty docker exec -ti d1 bash
root@d1fce4047033:/# uname -a
Linux d1fce4047033 4.9.125-linuxkit #1 SMP Fri Sep 7 08:20:28 UTC 2018 x86_64 GNU/Linux
root@d1fce4047033:/# apt-get clean
root@d1fce4047033:/# apt-get update
Err:1 http://security.debian.org/debian-security buster/updates InRelease
  503  Service Unavailable [IP: 212.211.132.250 80]
Err:2 http://deb.debian.org/debian buster InRelease
  503  Service Unavailable [IP: 5.153.231.4 80]
Err:3 http://deb.debian.org/debian buster-updates InRelease
  503  Service Unavailable [IP: 5.153.231.4 80]
Reading package lists... Done
W: Failed to fetch http://deb.debian.org/debian/dists/buster/InRelease  503  Service Unavailable [IP: 5.153.231.4 80]
W: Failed to fetch http://security.debian.org/debian-security/dists/buster/updates/InRelease  503  Service Unavailable [IP: 212.211.132.250 80]
W: Failed to fetch http://deb.debian.org/debian/dists/buster-updates/InRelease  503  Service Unavailable [IP: 5.153.231.4 80]
W: Some index files failed to download. They have been ignored, or old ones used instead.
root@d1fce4047033:/# ping 212.211.132.250
PING 212.211.132.250 (212.211.132.250) 56(84) bytes of data.
64 bytes from 212.211.132.250: icmp_seq=1 ttl=37 time=18.5 ms
^C
--- 212.211.132.250 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 6ms
rtt min/avg/max/mdev = 18.406/19.176/20.597/1.012 ms
    root@d1fce4047033:/# wget
bash: wget: command not found
root@d1fce4047033:/# curl
bash: curl: command not found

如你所见,更新失败了,但我已经连接到互联网了。尝试了几次,但都没有成功。因为当我尝试拉Ubuntu或其他东西时,它的行为是相同的,所以我认为这不是一个简单的原因。我已经通过wget在busybox上测试了其中一个文件的下载,它可以正常工作。另外,当我尝试通过浏览器下载网站时。那么这里发生了什么呢?

EN

回答 2

Stack Overflow用户

发布于 2019-07-11 21:22:09

这可能是防火墙规则阻止来自容器内部的请求。有时,防火墙配置为接受ICMP请求(ping),但阻止TCP/UPD流量。也许你可以在你的主机上检查一下iptables -L的结果。

票数 0
EN

Stack Overflow用户

发布于 2021-06-08 18:38:35

丑陋的修复方法是通过sed改变镜像和源代码

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/56989996

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档