- mysql镜像下载
docker pull mysql
- nginx镜像下载
docker pull nginx
- php镜像定制,以下为Dockerfile
FROM library/php:7.4-fpm
RUN export DEBIAN_FRONTEND=noninteractive && apt-get update && pecl channel-update pecl.php.net && apt-get install -y tar && apt-get install -y libpcre3-dev \
&& docker-php-ext-install -j$(nproc) bcmath mysqli pdo_mysql \
&& pecl install psr && pecl install igbinary && pecl install redis && pecl install phalcon \
&& echo 'extension=psr.so' > /usr/local/etc/php/conf.d/psr.ini \
&& echo 'extension=igbinary.so' > /usr/local/etc/php/conf.d/igbinary.ini \
&& echo 'extension=redis.so' > /usr/local/etc/php/conf.d/redis.ini \
&& echo 'extension=phalcon.so' > /usr/local/etc/php/conf.d/phalcon.ini \
&& cd /usr/local/etc/php && cp php.ini-development php.ini \
&& docker-php-source delete && pecl clear-cache
- 生成新的php镜像
docker build -f Dockerfile -t david/php:7.4-fpm
- LNMP启动脚本,docker-compose.yml如下:
正在调试中