在Dockerfile中添加以下兩句代碼:docker
RUN sed -i s@/archive.ubuntu.com/@/mirrors.aliyun.com/@g /etc/apt/sources.list RUN apt-get clean
更新apt源的Dockerfile以下:ubuntu
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