Docker ubuntu apt-get更换国内源解决Dockerfile构建速度过慢

时间:2019-06-20 23:59:44   收藏:0   阅读:972

创建Dockerfile并且更新apt源

在Dockerfile中添加如下两句代码:

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

更新apt源的Dockerfile如下:

FROM ubuntu:latest
MAINTAINER kk "kk@qq.com"
RUN  sed -i s@/archive.ubuntu.com/@/mirrors.aliyun.com/@g /etc/apt/sources.list
RUN  apt-get clean
RUN apt-get update

技术图片

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!