php-fpm容器环境搭建
安装mysql扩展:
docker-php-ext-install mysqli pdo_mysql :
安装gd扩展:
apt-get install -y libfreetype6-dev libjpeg62-turbo-dev libpng-dev
docker-php-ext-configure gd --with-freetype --with-jpeg && docker-php-ext-install -j$(nproc) gd
开启jpeg扩展
apt-get update && apt-get install -y libjpeg62-turbo libjpeg62-turbo-dev
/usr/local/bin/docker-php-ext-configure gd --with-jpeg-dir=/usr/include --with-freetype-dir=/usr/include/
docker-php-ext-install gd
Dockerfile:
FROM php:7.0-fpm-jessie
COPY sources.list /etc/apt/
COPY ./data /var/www/html
RUN apt-get update && apt-get install -y nginx libfreetype6-dev libjpeg62-turbo-dev libpng-dev --force-yes && \
docker-php-ext-install mysqli pdo_mysql && \
docker-php-ext-configure gd --with-freetype --with-jpeg && docker-php-ext-install -j$(nproc) gd
COPY nginx.conf /etc/nginx/nginx.conf
COPY myphp.conf /etc/nginx/conf.d/
COPY docker-php-entrypoint /usr/local/bin/
评论区