在dockerfile中有命令
RUN apt-get update && apt-get upgrade -y && apt-get autoremove -y
将其改为
RUN sed -i s@/archive.ubuntu.com/@/mirrors.ustc.edu.cn/@g /etc/apt/sources.list && apt-get update && apt-get upgrade -y && apt-get autoremove -y
换源后就成功了
docker中apt-get update出错hash sum mismatch
最新推荐文章于 2025-02-07 11:42:28 发布
本文介绍如何在Dockerfile中更改apt源以提高软件包更新和安装速度。通过修改/etc/apt/sources.list文件中的源地址,可以显著提升在Docker镜像构建过程中的效率。
3004

被折叠的 条评论
为什么被折叠?



