创建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 itdream "itdream6@163.com"
RUN  sed -i s@/archive.ubuntu.com/@/mirrors.aliyun.com/@g /etc/apt/sources.list
RUN  apt-get clean
RUN apt-get update

Logo

权威|前沿|技术|干货|国内首个API全生命周期开发者社区

更多推荐