我正在尝试构建docker映像,但遇到以下失败。
E: Failed to fetch http://cdn-fastly.deb.debian.org/debian/pool/main/t/tv-fonts/tv-fonts_1.1-8_all.deb Hash Sum mismatch
Hashes of expected file:
- SHA256:19e2e7a51c83dcf616a8f009c1cc39dc8c1755135983e5ec4abeacefbf977585
- MD5Sum:482a1f68c5ffff5117b2c6b25b740624 [weak]
- Filesize:2144504 [weak]
Hashes of received file:
- SHA256:fb6550c1d066571f3cee715bbaaf4528f547032e101b23f057a42c55c0dade84
- MD5Sum:4c118e8d7b54b7f23af0093b7a2dbef4 [weak]
- Filesize:246436 [weak]
Last modification reported: Tue, 18 Oct 2011 19:18:45 +0000
我已经搜索了此问题,但没有适合我的解决方案。我试图像下面那样清理apt-cache,但也没用。
RUN rm -rf /var/lib/apt/lists/* && \
apt-get clean && \
apt-get -y update
Docker版本:
Client:
Version: 18.03.1-ce
API version: 1.37
Go version: go1.9.5
Git commit: 9ee9f40
Built: Thu Apr 26 07:17:20 2018
OS/Arch: linux/amd64
Experimental: false
Orchestrator: swarm
有什么主意吗?
答案 0 :(得分:0)
您可以使用wget和dpkg命令,例如:
RUN apt-get install -y wget
RUN wget -O - http://cdn-fastly.deb.debian.org/debian/pool/main/t/tv-fonts/tv-fonts_1.1-8_all.deb | wc -l > /directory/tv-fonts_1.1-8_all.deb.deb
RUN dpkg -i --force-depends /directory/tv-fonts_1.1-8_all.deb.deb
您可以在dockerhub
中找到有关wget最佳做法的更多信息。