docker 修改Dockerfile 更换 apt 源 加快构建过程

在Dockerfile中,使用类似如下代码

RUN sed -i "s@http://deb.debian.org@http://mirrors.163.com@g" /etc/apt/sources.list
RUN cat /etc/apt/sources.list
RUN rm -Rf /var/lib/apt/lists/*
RUN apt-get update
RUN sed -i "s@http://deb.debian.org@http://mirrors.163.com@g" /etc/apt/sources.list && rm -Rf /var/lib/apt/lists/* && apt-get update
RUN sed -i "s@http://archive.ubuntu.com@http://mirrors.163.com@g" /etc/apt/sources.list && rm -Rf /var/lib/apt/lists/* && apt-get update
docker build -t dockerName .