docker部署php环境
编写Dockerfile
FROM php:7.4-fpm
# 扩展
RUN docker-php-ext-install -j$(nproc) bcmath calendar exif gettext sockets dba mysqli pcntl pdo_mysql sysvmsg sysvsem sysvshm zlib zip xmlwriter xml xmlreader simplexml shmop mcrypt mbstring libxml hash
# redis 扩展
#RUN pecl install redis-5.0.0 && docker-php-ext-enable redis
# 镜像信息
LABEL Author="arick"
LABEL Version="2022.7"
LABEL Description="PHP 7.4 开发环境镜像"
FROM php:5.6.40-fpm
# mysqli, pcntl, pdo_mysql, shmop, sysvmsg, sysvsem, sysvshm 扩展
RUN docker-php-ext-install -j$(nproc) bcmath calendar exif gettext sockets dba mysqli pcntl pdo_mysql sysvmsg sysvsem sysvshm zlib zip xmlwriter xml xmlreader simplexml shmop mcrypt mbstring libxml hash
# redis 扩展
RUN pecl install redis-5.0.0 && docker-php-ext-enable redis
# 镜像信息
LABEL Author="arick"
LABEL Version="2022.7"
LABEL Description="PHP 7.4 开发环境镜像"
构建镜像
docker build -t php-mysqli:7.4-fpm .