Dockerfile 代码如下:
yaml
FROM php:5.6-apache
# 使用Debian归档源
RUN echo "deb http://archive.debian.org/debian stretch main contrib non-free" > /etc/apt/sources.list && \
echo "deb http://archive.debian.org/debian-security stretch/updates main contrib non-free" >> /etc/apt/sources.list
# 安装依赖(允许未验证的包)
RUN apt-get update && \
apt-get install -y --allow-unauthenticated \
libpng-dev \
libjpeg-dev \
libfreetype6-dev \
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
&& docker-php-ext-install -j$(nproc) gd mysqli \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*