Linux Dockerfile设置阿里云镜像源
时间: 2024-06-10 21:03:51 浏览: 326
ubuntu 阿里云镜像源
您可以在 Dockerfile 中加入以下命令来设置阿里云镜像源:
```
RUN echo "deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse" > /etc/apt/sources.list \
&& echo "deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse" >> /etc/apt/sources.list \
&& echo "deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse" >> /etc/apt/sources.list \
&& echo "deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse" >> /etc/apt/sources.list \
&& apt-get update \
&& apt-get install -y your-packages
```
其中,your-packages 是您需要安装的软件包。这样做可以加速 Docker 容器中软件包的安装过程。
阅读全文