docker php-fpm 镜像修改apt源

使用 dockerfile 创建 php-fpm 镜像。在进行 apt-get install 安装包时下载很慢。严重影响镜像的构建速度。

可以使用如下方法进行替换

FROM php:7.1-fpm

# 使用 阿里源 替换
RUN sed -i "s@http://deb.debian.org@http://mirrors.aliyun.com@g" /etc/apt/sources.list && rm -Rf /var/lib/apt/lists/* &&  cat /etc/apt/sources.list

# 测试
RUN apt-get update && \
    apt-get install -y --no-install-recommends \
        wget \
        rsyslog 

你可能感兴趣的:(docker php-fpm 镜像修改apt源)