Dockerfile中将apt更换为阿里源

在国内运行Dockerfile指令时,apt的源未经过修改,默认为Ubuntu的官方源,如果直接通过apt-get install会非常慢甚至失败,如果你以前使用过Ubuntu的apt,你应该会非常熟悉

编辑Dockerfile文件,在apt-get install前将源改为阿里源即可:

RUN sed -i s@/archive.ubuntu.com/@/mirrors.aliyun.com/@g /etc/apt/sources.list
RUN apt-get update

....
....
....

RUN apt-get install -y xxxxxxx

猜你喜欢

转载自blog.csdn.net/qq_41129489/article/details/124725858
今日推荐