php-fpm-alpine扩展

拉取镜像

docker image pull php:7.4.27-fpm-alpine

后台运行容器

docker container run --name my-php-fpm -d php:7.4.27-fpm-alpine

以交互式进入my-php-fpm容器

docker container exec -it my-php-fpm sh

php扩展

该镜像提供了一种更加便捷的方式来安装扩展

pdo_mysql

/usr/local/bin/docker-php-ext-install pdo_mysql

gd

apk add libjpeg-turbo-dev libzip-dev libpng-dev freetype-dev && \
docker-php-ext-configure gd --with-jpeg --with-freetype && \
docker-php-ext-install gd

redis

docker-php-source extract && \
wget http://pecl.php.net/get/redis-5.3.5.tgz && \
tar -xzf redis-5.3.5.tgz && \
mv redis-5.3.5 /usr/src/php/ext/redis && \
docker-php-ext-install redis
评论
:broken_heart: :confounded: :flushed: :frowning: :grinning: :heart: :kissing_heart: :mask: :pensive: :rage: :relaxed: :scream: :smile: :smirk: :sob: :stuck_out_tongue_closed_eyes: :stuck_out_tongue_winking_eye: :wink: