Dockerfile 基于Ubuntu构建镜像 ERROR: failed to solve: process "/bin/sh -c apt-get install vim" did not complete successfully: exit code: 100
在使用Dockerfile基于ubuntu构建镜像时,如果有apt-get install命令,老是出现以下错误:process "/bin/sh -c apt-get install vim" did not complete successfully: exit code: 100
查了一下,发现很多人都说是使用ubuntu原始的源在apt-get install下载新包时,可能因为网络问题导致出现此报错。尝试了一下换源,果然成功解决了问题,下面附上解决方法。
解决方法
原始命令
RUN apt-get install -y vim
修改方法
RUN sed -i 's#http://archive.ubuntu.com/#http://mirrors.tuna.tsinghua.edu.cn/#' /etc/apt/sources.list; RUN apt-get update --fix-missing && apt-get install -y vim --fix-missing