![docker 中的 apt-get update 陷入无限循环,获取相同的软件包列表](https://linux22.com/image/1592836/docker%20%E4%B8%AD%E7%9A%84%20apt-get%20update%20%E9%99%B7%E5%85%A5%E6%97%A0%E9%99%90%E5%BE%AA%E7%8E%AF%EF%BC%8C%E8%8E%B7%E5%8F%96%E7%9B%B8%E5%90%8C%E7%9A%84%E8%BD%AF%E4%BB%B6%E5%8C%85%E5%88%97%E8%A1%A8.png)
我尝试Apromore
通过 docker 启动并运行,从其存储库中获取最新的 docker (19.03.0-beta4) 和 docker-compose (1.24.0) 版本,我还有 Ubuntu 19.04。发布docker-compose up
启动构建过程,但当涉及到时apt-get update
,它开始重复获取相同的包列表,似乎陷入了无限循环。任何帮助都值得感激。
Step 3/24 : RUN apt-get -y update && sed -i -e '/^assistive_technologies=/s/^/#/' /etc/java-8-openjdk/accessibility.properties && apt-get -y install git && apt-get -y install python3 && apt-get -y install python3-pip && apt-get -y install xvfb && apt-get -y install python3-tk && apt-get -y clean
---> Running in fdd310721344
Ign:1 http://deb.debian.org/debian stretch InRelease
Ign:2 http://security.debian.org/debian-security stretch/updates InRelease
Ign:3 http://deb.debian.org/debian stretch-updates InRelease
Get:4 http://security.debian.org/debian-security stretch/updates Release [92.7 kB]
Get:4 http://security.debian.org/debian-security stretch/updates Release [92.7 kB]
Ign:5 http://deb.debian.org/debian stretch Release
Get:6 http://deb.debian.org/debian stretch-updates Release [89.4 kB]
Get:4 http://security.debian.org/debian-security stretch/updates Release [92.7 kB]
Get:4 http://security.debian.org/debian-security stretch/updates Release [92.7 kB]
Get:6 http://deb.debian.org/debian stretch-updates Release [89.4 kB]
Ign:6 http://deb.debian.org/debian stretch-updates Release
Get:7 http://deb.debian.org/debian stretch/main all Packages [3358 kB]
Get:4 http://security.debian.org/debian-security stretch/updates Release [92.7 kB]
Ign:4 http://security.debian.org/debian-security stretch/updates Release
Get:8 http://security.debian.org/debian-security stretch/updates/main amd64 Packages [492 kB]
Get:7 http://deb.debian.org/debian stretch/main all Packages [3358 kB]
Get:8 http://security.debian.org/debian-security stretch/updates/main amd64 Packages [492 kB]
Get:7 http://deb.debian.org/debian stretch/main all Packages [3358 kB]
Get:8 http://security.debian.org/debian-security stretch/updates/main amd64 Packages [492 kB]
Get:7 http://deb.debian.org/debian stretch/main all Packages [3358 kB]
Get:8 http://security.debian.org/debian-security stretch/updates/main amd64 Packages [492 kB]
Get:7 http://deb.debian.org/debian stretch/main all Packages [3358 kB]
Get:8 http://security.debian.org/debian-security stretch/updates/main amd64 Packages [492 kB]
Get:7 http://deb.debian.org/debian stretch/main all Packages [3358 kB]
答案1
与此同时,问题被证明是 VPN 造成的。现在问题解决了。
答案2
将您的更改RUN
为这些行
RUN sed -i -e '/^assistive_technologies=/s/^/#/' /etc/java-8-openjdk/accessibility.properties
RUN apt-get -y update && apt-get -y install \
git \
python3 \
python3-pip \
xvfb \
python3-tk
RUN apt-get -y clean
再试一次,然后我们将看到哪个运行导致了循环