使用 dockerfile 創(chuàng)建 php-fpm 鏡像。在進行 apt-get install 安裝包時下載很慢。嚴重影響鏡像的構(gòu)建速度。
可以使用如下方法進行替換
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