加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
php.dockerfile 1.43 KB
一键复制 编辑 原始数据 按行查看 历史
zhuyuejianke 提交于 2018-06-18 14:22 . init
FROM php:7.2-fpm-alpine3.7
RUN set -xe; \
# cp /etc/apk/repositories /etc/apk/repositories.bak; \
# echo "http://mirrors.aliyun.com/alpine/v3.7/main/" > /etc/apk/repositories; \
apk update; \
apk add --no-cache libevent libjpeg libwebp libpng freetype openssl; \
apk add --no-cache --virtual .build-deps \
libpng-dev libwebp-dev libevent-dev libxml2-dev freetype-dev openssl-dev libc-dev gcc make autoconf; \
docker-php-ext-install -j$(nproc) pdo pdo_mysql bcmath mysqli pcntl sockets zip opcache posix; \
wget https://pecl.php.net/get/event-2.3.0.tgz; \
tar -zxvf event-2.3.0.tgz; \
cd event-2.3.0; \
phpize; \
./configure --with-php-config=/usr/local/bin/php-config; \
make; \
make install; \
cd ..; \
rm event-2.3.0.tgz; \
rm -rf event-2.3.0; \
# 自动安装会导致错误,手动安装
# docker-php-ext-enable event; \
echo -e "extension=sockets.so\nextension=event.so\n" > /usr/local/etc/php/conf.d/docker-php-ext-sockets.ini; \
apk del .build-deps; \
docker-php-source extract; \
cp /usr/src/php/php.ini-development /usr/local/etc/php/php.ini; \
docker-php-source delete;
RUN set -xe \
&& php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" \
&& php composer-setup.php \
&& php -r "unlink('composer-setup.php');" \
&& mv composer.phar /usr/local/bin/composer \
&& composer self-update \
&& composer config -g repo.packagist composer https://packagist.phpcomposer.com
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化