新的workerman和grpc镜像,auto中更新的php版本
This commit is contained in:
parent
ee5ea0d3da
commit
47efbda9de
@ -594,7 +594,15 @@ images:
|
|||||||
|
|
||||||
- name: "php"
|
- name: "php"
|
||||||
tags:
|
tags:
|
||||||
- tag: "8.3.12-fpm-alpine"
|
- tag: "8.4.1-fpm-alpine"
|
||||||
|
platforms:
|
||||||
|
- "linux/amd64"
|
||||||
|
- "linux/arm64"
|
||||||
|
- tag: "8.4-fpm-alpine"
|
||||||
|
platforms:
|
||||||
|
- "linux/amd64"
|
||||||
|
- "linux/arm64"
|
||||||
|
- tag: "8.3.14-fpm-alpine"
|
||||||
platforms:
|
platforms:
|
||||||
- "linux/amd64"
|
- "linux/amd64"
|
||||||
- "linux/arm64"
|
- "linux/arm64"
|
||||||
@ -602,7 +610,7 @@ images:
|
|||||||
platforms:
|
platforms:
|
||||||
- "linux/amd64"
|
- "linux/amd64"
|
||||||
- "linux/arm64"
|
- "linux/arm64"
|
||||||
- tag: "8.2.24-fpm-alpine"
|
- tag: "8.2.26-fpm-alpine"
|
||||||
platforms:
|
platforms:
|
||||||
- "linux/amd64"
|
- "linux/amd64"
|
||||||
- "linux/arm64"
|
- "linux/arm64"
|
||||||
@ -610,7 +618,7 @@ images:
|
|||||||
platforms:
|
platforms:
|
||||||
- "linux/amd64"
|
- "linux/amd64"
|
||||||
- "linux/arm64"
|
- "linux/arm64"
|
||||||
- tag: "8.1.30-fpm-alpine"
|
- tag: "8.1.31-fpm-alpine"
|
||||||
platforms:
|
platforms:
|
||||||
- "linux/amd64"
|
- "linux/amd64"
|
||||||
- "linux/arm64"
|
- "linux/arm64"
|
||||||
@ -634,7 +642,15 @@ images:
|
|||||||
platforms:
|
platforms:
|
||||||
- "linux/amd64"
|
- "linux/amd64"
|
||||||
- "linux/arm64"
|
- "linux/arm64"
|
||||||
- tag: "8.3.12-cli-alpine"
|
- tag: "8.4.1-cli-alpine"
|
||||||
|
platforms:
|
||||||
|
- "linux/amd64"
|
||||||
|
- "linux/arm64"
|
||||||
|
- tag: "8.4-cli-alpine"
|
||||||
|
platforms:
|
||||||
|
- "linux/amd64"
|
||||||
|
- "linux/arm64"
|
||||||
|
- tag: "8.3.14-cli-alpine"
|
||||||
platforms:
|
platforms:
|
||||||
- "linux/amd64"
|
- "linux/amd64"
|
||||||
- "linux/arm64"
|
- "linux/arm64"
|
||||||
@ -642,7 +658,7 @@ images:
|
|||||||
platforms:
|
platforms:
|
||||||
- "linux/amd64"
|
- "linux/amd64"
|
||||||
- "linux/arm64"
|
- "linux/arm64"
|
||||||
- tag: "8.2.24-cli-alpine"
|
- tag: "8.2.26-cli-alpine"
|
||||||
platforms:
|
platforms:
|
||||||
- "linux/amd64"
|
- "linux/amd64"
|
||||||
- "linux/arm64"
|
- "linux/arm64"
|
||||||
@ -650,7 +666,7 @@ images:
|
|||||||
platforms:
|
platforms:
|
||||||
- "linux/amd64"
|
- "linux/amd64"
|
||||||
- "linux/arm64"
|
- "linux/arm64"
|
||||||
- tag: "8.1.30-cli-alpine"
|
- tag: "8.1.31-cli-alpine"
|
||||||
platforms:
|
platforms:
|
||||||
- "linux/amd64"
|
- "linux/amd64"
|
||||||
- "linux/arm64"
|
- "linux/arm64"
|
||||||
@ -674,7 +690,15 @@ images:
|
|||||||
platforms:
|
platforms:
|
||||||
- "linux/amd64"
|
- "linux/amd64"
|
||||||
- "linux/arm64"
|
- "linux/arm64"
|
||||||
- tag: "8.3.12-fpm"
|
- tag: "8.4.1-fpm"
|
||||||
|
platforms:
|
||||||
|
- "linux/amd64"
|
||||||
|
- "linux/arm64"
|
||||||
|
- tag: "8.4-fpm"
|
||||||
|
platforms:
|
||||||
|
- "linux/amd64"
|
||||||
|
- "linux/arm64"
|
||||||
|
- tag: "8.3.14-fpm"
|
||||||
platforms:
|
platforms:
|
||||||
- "linux/amd64"
|
- "linux/amd64"
|
||||||
- "linux/arm64"
|
- "linux/arm64"
|
||||||
@ -682,7 +706,7 @@ images:
|
|||||||
platforms:
|
platforms:
|
||||||
- "linux/amd64"
|
- "linux/amd64"
|
||||||
- "linux/arm64"
|
- "linux/arm64"
|
||||||
- tag: "8.2.24-fpm"
|
- tag: "8.2.26-fpm"
|
||||||
platforms:
|
platforms:
|
||||||
- "linux/amd64"
|
- "linux/amd64"
|
||||||
- "linux/arm64"
|
- "linux/arm64"
|
||||||
@ -690,7 +714,7 @@ images:
|
|||||||
platforms:
|
platforms:
|
||||||
- "linux/amd64"
|
- "linux/amd64"
|
||||||
- "linux/arm64"
|
- "linux/arm64"
|
||||||
- tag: "8.1.30-fpm"
|
- tag: "8.1.31-fpm"
|
||||||
platforms:
|
platforms:
|
||||||
- "linux/amd64"
|
- "linux/amd64"
|
||||||
- "linux/arm64"
|
- "linux/arm64"
|
||||||
@ -714,7 +738,15 @@ images:
|
|||||||
platforms:
|
platforms:
|
||||||
- "linux/amd64"
|
- "linux/amd64"
|
||||||
- "linux/arm64"
|
- "linux/arm64"
|
||||||
- tag: "8.3.12-cli"
|
- tag: "8.4.1-cli"
|
||||||
|
platforms:
|
||||||
|
- "linux/amd64"
|
||||||
|
- "linux/arm64"
|
||||||
|
- tag: "8.4-cli"
|
||||||
|
platforms:
|
||||||
|
- "linux/amd64"
|
||||||
|
- "linux/arm64"
|
||||||
|
- tag: "8.3.14-cli"
|
||||||
platforms:
|
platforms:
|
||||||
- "linux/amd64"
|
- "linux/amd64"
|
||||||
- "linux/arm64"
|
- "linux/arm64"
|
||||||
@ -722,7 +754,7 @@ images:
|
|||||||
platforms:
|
platforms:
|
||||||
- "linux/amd64"
|
- "linux/amd64"
|
||||||
- "linux/arm64"
|
- "linux/arm64"
|
||||||
- tag: "8.2.24-cli"
|
- tag: "8.2.26-cli"
|
||||||
platforms:
|
platforms:
|
||||||
- "linux/amd64"
|
- "linux/amd64"
|
||||||
- "linux/arm64"
|
- "linux/arm64"
|
||||||
@ -730,7 +762,7 @@ images:
|
|||||||
platforms:
|
platforms:
|
||||||
- "linux/amd64"
|
- "linux/amd64"
|
||||||
- "linux/arm64"
|
- "linux/arm64"
|
||||||
- tag: "8.1.30-cli"
|
- tag: "8.1.31-cli"
|
||||||
platforms:
|
platforms:
|
||||||
- "linux/amd64"
|
- "linux/amd64"
|
||||||
- "linux/arm64"
|
- "linux/arm64"
|
||||||
|
88
manual/php/Dockerfile_8.1-grpc
Normal file
88
manual/php/Dockerfile_8.1-grpc
Normal file
@ -0,0 +1,88 @@
|
|||||||
|
# 拉基础镜像
|
||||||
|
FROM php:8.1-cli
|
||||||
|
|
||||||
|
# 替换源
|
||||||
|
RUN rm -rf /etc/apt/sources.list.d/debian.sources \
|
||||||
|
&& echo 'deb http://mirror.us.oneandone.net/debian bookworm main' > /etc/apt/sources.list \
|
||||||
|
&& echo 'deb-src http://mirror.us.oneandone.net/debian bookworm main' >> /etc/apt/sources.list \
|
||||||
|
&& apt-get update \
|
||||||
|
&& apt-get install -y netselect-apt \
|
||||||
|
&& netselect-apt --sources bookworm \
|
||||||
|
&& mv sources.list /etc/apt/ \
|
||||||
|
&& apt-get update
|
||||||
|
|
||||||
|
# socket event pcntl
|
||||||
|
RUN docker-php-ext-install sockets \
|
||||||
|
&& apt-get install -y libevent-dev \
|
||||||
|
&& printf "no\nyes\n/usr\nno\nyes\nno\nno\nyes\n" | pecl install https://pecl.php.net/get/event-3.1.4.tgz \
|
||||||
|
&& docker-php-ext-enable event \
|
||||||
|
&& cat /usr/local/etc/php/conf.d/docker-php-ext-event.ini >> /usr/local/etc/php/conf.d/docker-php-ext-sockets.ini \
|
||||||
|
&& mv /usr/local/etc/php/conf.d/docker-php-ext-sockets.ini /usr/local/etc/php/conf.d/docker-php-ext-event.ini \
|
||||||
|
&& docker-php-ext-install pcntl
|
||||||
|
|
||||||
|
# pdo_mysql mysqli opcache exif bcmath(任意精度的数学库)
|
||||||
|
RUN docker-php-ext-install pdo_mysql \
|
||||||
|
mysqli \
|
||||||
|
opcache \
|
||||||
|
exif \
|
||||||
|
bcmath
|
||||||
|
|
||||||
|
# gmp(大整数支持)
|
||||||
|
RUN apt-get install -y libgmp-dev \
|
||||||
|
&& docker-php-ext-install gmp
|
||||||
|
|
||||||
|
# gd
|
||||||
|
RUN apt-get install -y \
|
||||||
|
libfreetype6-dev \
|
||||||
|
libjpeg62-turbo-dev \
|
||||||
|
libpng-dev \
|
||||||
|
libwebp-dev \
|
||||||
|
&& docker-php-ext-configure gd --enable-gd --with-freetype --with-jpeg --with-webp \
|
||||||
|
&& docker-php-ext-install -j$(nproc) gd
|
||||||
|
|
||||||
|
# redis
|
||||||
|
RUN printf "no\nno\nno\nno\nno\nyes\n" | pecl install https://pecl.php.net/get/redis-6.1.0.tgz \
|
||||||
|
&& docker-php-ext-enable redis
|
||||||
|
|
||||||
|
# pdo_pgsql pgsql
|
||||||
|
RUN apt-get install -y libpq-dev \
|
||||||
|
&& docker-php-ext-install -j$(nproc) pgsql pdo_pgsql
|
||||||
|
|
||||||
|
# mongodb
|
||||||
|
RUN printf "no\nno\nno\nauto\nauto\nauto\nauto\nauto\nauto\nno\nbundled\n" | pecl install https://pecl.php.net/get/mongodb-1.19.3.tgz \
|
||||||
|
&& docker-php-ext-enable mongodb
|
||||||
|
|
||||||
|
# xlswriter
|
||||||
|
RUN printf "yes\n" | pecl install https://pecl.php.net/get/xlswriter-1.5.5.tgz \
|
||||||
|
&& docker-php-ext-enable xlswriter
|
||||||
|
|
||||||
|
# zip
|
||||||
|
RUN apt-get install -y libzip-dev zip \
|
||||||
|
&& docker-php-ext-install zip
|
||||||
|
|
||||||
|
# protobuf
|
||||||
|
RUN pecl install https://pecl.php.net/get/protobuf-4.29.1.tgz \
|
||||||
|
&& docker-php-ext-enable protobuf
|
||||||
|
|
||||||
|
# grpc(客户端)
|
||||||
|
RUN pecl install https://pecl.php.net/get/grpc-1.68.0.tgz \
|
||||||
|
&& docker-php-ext-enable grpc
|
||||||
|
|
||||||
|
# composer
|
||||||
|
RUN 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
|
||||||
|
|
||||||
|
# swow(安装后默认不加载,使用php -d extension=swow在运行时加载)
|
||||||
|
RUN composer require swow/swow \
|
||||||
|
&& ./vendor/bin/swow-builder --install \
|
||||||
|
&& rm -rf vendor
|
||||||
|
|
||||||
|
RUN apt-get clean
|
||||||
|
|
||||||
|
# 创建应用目录
|
||||||
|
RUN mkdir -p /app
|
||||||
|
|
||||||
|
# 设置工作目录
|
||||||
|
WORKDIR /app
|
@ -1,80 +1,81 @@
|
|||||||
# 拉基础镜像
|
# 拉基础镜像
|
||||||
FROM php:8.1.31-cli
|
FROM php:8.1-cli
|
||||||
|
|
||||||
# 替换源
|
# 替换源
|
||||||
RUN rm /etc/apt/sources.list.d/debian.sources && \
|
RUN rm -rf /etc/apt/sources.list.d/debian.sources \
|
||||||
echo 'deb http://mirror.us.oneandone.net/debian bookworm main' > /etc/apt/sources.list && \
|
&& echo 'deb http://mirror.us.oneandone.net/debian bookworm main' > /etc/apt/sources.list \
|
||||||
echo 'deb-src http://mirror.us.oneandone.net/debian bookworm main' >> /etc/apt/sources.list && \
|
&& echo 'deb-src http://mirror.us.oneandone.net/debian bookworm main' >> /etc/apt/sources.list \
|
||||||
echo 'deb http://mirror.us.oneandone.net/debian-security bookworm-security main' >> /etc/apt/sources.list && \
|
&& apt-get update \
|
||||||
echo 'deb-src http://mirror.us.oneandone.net/debian-security bookworm-security main' >> /etc/apt/sources.list && \
|
&& apt-get install -y netselect-apt \
|
||||||
echo 'deb http://mirror.us.oneandone.net/debian bookworm-updates main' >> /etc/apt/sources.list && \
|
&& netselect-apt --sources bookworm \
|
||||||
echo 'deb-src http://mirror.us.oneandone.net/debian bookworm-updates main' >> /etc/apt/sources.list && \
|
&& mv sources.list /etc/apt/ \
|
||||||
echo 'deb http://mirror.us.oneandone.net/debian bookworm-backports main' >> /etc/apt/sources.list && \
|
&& apt-get update
|
||||||
echo 'deb-src http://mirror.us.oneandone.net/debian bookworm-backports main' >> /etc/apt/sources.list
|
|
||||||
|
|
||||||
# 安装一些依赖
|
|
||||||
RUN apt-get update && apt-get install -y \
|
|
||||||
libfreetype6-dev libjpeg62-turbo-dev \
|
|
||||||
libpng-dev libwebp-dev zlib1g-dev \
|
|
||||||
libzip-dev zip \
|
|
||||||
libevent-dev libssl-dev \
|
|
||||||
lsb-release libpq-dev \
|
|
||||||
libgmp-dev \
|
|
||||||
libmagickwand-dev \
|
|
||||||
libzookeeper-mt-dev \
|
|
||||||
librdkafka-dev \
|
|
||||||
&& apt-get install -y \
|
|
||||||
libprotobuf-dev \
|
|
||||||
&& apt-get install -y \
|
|
||||||
protobuf-compiler \
|
|
||||||
&& apt-get install -y \
|
|
||||||
pkg-config \
|
|
||||||
&& apt-get install -y \
|
|
||||||
git
|
|
||||||
|
|
||||||
# 安装扩展
|
# pcntl socket event
|
||||||
RUN docker-php-ext-configure gd --enable-gd --with-freetype --with-jpeg --with-webp \
|
RUN docker-php-ext-install pcntl sockets \
|
||||||
&& docker-php-ext-install -j$(nproc) gd \
|
&& apt-get install -y libevent-dev \
|
||||||
&& docker-php-ext-install exif \
|
&& printf "no\nyes\n/usr\nno\nyes\nno\nno\nyes\n" | pecl install https://pecl.php.net/get/event-3.1.4.tgz \
|
||||||
&& docker-php-ext-install opcache \
|
|
||||||
&& docker-php-ext-install pdo_mysql \
|
|
||||||
&& docker-php-ext-install mysqli \
|
|
||||||
&& docker-php-ext-install zip \
|
|
||||||
&& docker-php-ext-install pcntl \
|
|
||||||
&& docker-php-ext-install fileinfo \
|
|
||||||
&& pecl install https://pecl.php.net/get/redis-6.1.0.tgz \
|
|
||||||
&& docker-php-ext-enable redis \
|
|
||||||
&& docker-php-ext-install sockets \
|
|
||||||
&& pecl install https://pecl.php.net/get/event-3.1.4.tgz \
|
|
||||||
&& docker-php-ext-enable event \
|
&& docker-php-ext-enable event \
|
||||||
&& cat /usr/local/etc/php/conf.d/docker-php-ext-event.ini >> /usr/local/etc/php/conf.d/docker-php-ext-sockets.ini \
|
&& cat /usr/local/etc/php/conf.d/docker-php-ext-event.ini >> /usr/local/etc/php/conf.d/docker-php-ext-sockets.ini \
|
||||||
&& mv /usr/local/etc/php/conf.d/docker-php-ext-sockets.ini /usr/local/etc/php/conf.d/docker-php-ext-event.ini \
|
&& mv /usr/local/etc/php/conf.d/docker-php-ext-sockets.ini /usr/local/etc/php/conf.d/docker-php-ext-event.ini
|
||||||
&& docker-php-ext-install -j$(nproc) pgsql pdo_pgsql \
|
|
||||||
&& pecl install https://pecl.php.net/get/mongodb-1.19.3.tgz \
|
|
||||||
&& docker-php-ext-enable mongodb \
|
|
||||||
&& docker-php-ext-install -j$(nproc) gmp \
|
|
||||||
&& pecl install https://pecl.php.net/get/imagick-3.7.0.tgz \
|
|
||||||
&& docker-php-ext-enable imagick \
|
|
||||||
&& docker-php-ext-install bcmath \
|
|
||||||
&& docker-php-ext-enable bcmath \
|
|
||||||
&& pecl install https://pecl.php.net/get/xlswriter-1.5.5.tgz \
|
|
||||||
&& docker-php-ext-enable xlswriter \
|
|
||||||
&& pecl install https://pecl.php.net/get/zookeeper-1.2.1.tgz \
|
|
||||||
&& docker-php-ext-enable zookeeper \
|
|
||||||
&& pecl install https://pecl.php.net/get/rdkafka-6.0.3.tgz \
|
|
||||||
&& docker-php-ext-enable rdkafka \
|
|
||||||
# 安装 gRPC 扩展
|
|
||||||
&& pecl install grpc \
|
|
||||||
&& docker-php-ext-enable grpc
|
|
||||||
|
|
||||||
# 安装Composer
|
# pdo_mysql mysqli opcache exif bcmath(任意精度的数学库)
|
||||||
|
RUN docker-php-ext-install pdo_mysql \
|
||||||
|
mysqli \
|
||||||
|
opcache \
|
||||||
|
exif \
|
||||||
|
bcmath
|
||||||
|
|
||||||
|
# gd
|
||||||
|
RUN apt-get install -y \
|
||||||
|
libfreetype6-dev \
|
||||||
|
libjpeg62-turbo-dev \
|
||||||
|
libpng-dev \
|
||||||
|
libwebp-dev \
|
||||||
|
&& docker-php-ext-configure gd --enable-gd --with-freetype --with-jpeg --with-webp \
|
||||||
|
&& docker-php-ext-install -j$(nproc) gd
|
||||||
|
|
||||||
|
# gmp(大整数支持)
|
||||||
|
RUN apt-get install -y libgmp-dev \
|
||||||
|
&& docker-php-ext-install gmp
|
||||||
|
|
||||||
|
# redis
|
||||||
|
RUN printf "no\nno\nno\nno\nno\nyes\n" | pecl install https://pecl.php.net/get/redis-6.1.0.tgz \
|
||||||
|
&& docker-php-ext-enable redis
|
||||||
|
|
||||||
|
# pdo_pgsql pgsql
|
||||||
|
RUN apt-get install -y libpq-dev \
|
||||||
|
&& docker-php-ext-install -j$(nproc) pgsql pdo_pgsql
|
||||||
|
|
||||||
|
# mongodb
|
||||||
|
RUN printf "no\nno\nno\nauto\nauto\nauto\nauto\nauto\nauto\nno\nbundled\n" | pecl install https://pecl.php.net/get/mongodb-1.19.3.tgz \
|
||||||
|
&& docker-php-ext-enable mongodb
|
||||||
|
|
||||||
|
# xlswriter
|
||||||
|
RUN printf "yes\n" | pecl install https://pecl.php.net/get/xlswriter-1.5.5.tgz \
|
||||||
|
&& docker-php-ext-enable xlswriter
|
||||||
|
|
||||||
|
# zip
|
||||||
|
RUN apt-get install -y libzip-dev zip \
|
||||||
|
&& docker-php-ext-install zip
|
||||||
|
|
||||||
|
# protobuf
|
||||||
|
RUN pecl install https://pecl.php.net/get/protobuf-4.29.1.tgz \
|
||||||
|
&& docker-php-ext-enable protobuf
|
||||||
|
|
||||||
|
# composer
|
||||||
RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" \
|
RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" \
|
||||||
&& php composer-setup.php \
|
&& php composer-setup.php \
|
||||||
&& php -r "unlink('composer-setup.php');" \
|
&& php -r "unlink('composer-setup.php');" \
|
||||||
&& mv composer.phar /usr/local/bin/composer
|
&& mv composer.phar /usr/local/bin/composer
|
||||||
|
|
||||||
# 安装swow扩展
|
# swow(安装后默认不加载,使用php -d extension=swow在运行时加载)
|
||||||
# RUN composer require swow/swow && ./vendor/bin/swow-builder --install
|
RUN composer require swow/swow \
|
||||||
|
&& ./vendor/bin/swow-builder --install \
|
||||||
|
&& rm -rf vendor
|
||||||
|
|
||||||
|
RUN apt-get clean
|
||||||
|
|
||||||
# 创建应用目录
|
# 创建应用目录
|
||||||
RUN mkdir -p /app
|
RUN mkdir -p /app
|
||||||
|
89
manual/php/Dockerfile_8.2-grpc
Normal file
89
manual/php/Dockerfile_8.2-grpc
Normal file
@ -0,0 +1,89 @@
|
|||||||
|
# 拉基础镜像
|
||||||
|
FROM php:8.2-cli
|
||||||
|
|
||||||
|
# 替换源
|
||||||
|
RUN rm -rf /etc/apt/sources.list.d/debian.sources \
|
||||||
|
&& echo 'deb http://mirror.us.oneandone.net/debian bookworm main' > /etc/apt/sources.list \
|
||||||
|
&& echo 'deb-src http://mirror.us.oneandone.net/debian bookworm main' >> /etc/apt/sources.list \
|
||||||
|
&& apt-get update \
|
||||||
|
&& apt-get install -y netselect-apt \
|
||||||
|
&& netselect-apt --sources bookworm \
|
||||||
|
&& mv sources.list /etc/apt/ \
|
||||||
|
&& apt-get update
|
||||||
|
|
||||||
|
|
||||||
|
# socket event pcntl
|
||||||
|
RUN docker-php-ext-install sockets \
|
||||||
|
&& apt-get install -y libevent-dev \
|
||||||
|
&& printf "no\nyes\n/usr\nno\nyes\nno\nno\nyes\n" | pecl install https://pecl.php.net/get/event-3.1.4.tgz \
|
||||||
|
&& docker-php-ext-enable event \
|
||||||
|
&& cat /usr/local/etc/php/conf.d/docker-php-ext-event.ini >> /usr/local/etc/php/conf.d/docker-php-ext-sockets.ini \
|
||||||
|
&& mv /usr/local/etc/php/conf.d/docker-php-ext-sockets.ini /usr/local/etc/php/conf.d/docker-php-ext-event.ini \
|
||||||
|
&& docker-php-ext-install pcntl
|
||||||
|
|
||||||
|
# pdo_mysql mysqli opcache exif bcmath(任意精度的数学库)
|
||||||
|
RUN docker-php-ext-install pdo_mysql \
|
||||||
|
mysqli \
|
||||||
|
opcache \
|
||||||
|
exif \
|
||||||
|
bcmath
|
||||||
|
|
||||||
|
# gmp(大整数支持)
|
||||||
|
RUN apt-get install -y libgmp-dev \
|
||||||
|
&& docker-php-ext-install gmp
|
||||||
|
|
||||||
|
# gd
|
||||||
|
RUN apt-get install -y \
|
||||||
|
libfreetype6-dev \
|
||||||
|
libjpeg62-turbo-dev \
|
||||||
|
libpng-dev \
|
||||||
|
libwebp-dev \
|
||||||
|
&& docker-php-ext-configure gd --enable-gd --with-freetype --with-jpeg --with-webp \
|
||||||
|
&& docker-php-ext-install -j$(nproc) gd
|
||||||
|
|
||||||
|
# redis
|
||||||
|
RUN printf "no\nno\nno\nno\nno\nyes\n" | pecl install https://pecl.php.net/get/redis-6.1.0.tgz \
|
||||||
|
&& docker-php-ext-enable redis
|
||||||
|
|
||||||
|
# pdo_pgsql pgsql
|
||||||
|
RUN apt-get install -y libpq-dev \
|
||||||
|
&& docker-php-ext-install -j$(nproc) pgsql pdo_pgsql
|
||||||
|
|
||||||
|
# mongodb
|
||||||
|
RUN printf "no\nno\nno\nauto\nauto\nauto\nauto\nauto\nauto\nno\nbundled\n" | pecl install https://pecl.php.net/get/mongodb-1.19.3.tgz \
|
||||||
|
&& docker-php-ext-enable mongodb
|
||||||
|
|
||||||
|
# xlswriter
|
||||||
|
RUN printf "yes\n" | pecl install https://pecl.php.net/get/xlswriter-1.5.5.tgz \
|
||||||
|
&& docker-php-ext-enable xlswriter
|
||||||
|
|
||||||
|
# zip
|
||||||
|
RUN apt-get install -y libzip-dev zip \
|
||||||
|
&& docker-php-ext-install zip
|
||||||
|
|
||||||
|
# protobuf
|
||||||
|
RUN pecl install https://pecl.php.net/get/protobuf-4.29.1.tgz \
|
||||||
|
&& docker-php-ext-enable protobuf
|
||||||
|
|
||||||
|
# grpc(客户端)
|
||||||
|
RUN pecl install https://pecl.php.net/get/grpc-1.68.0.tgz \
|
||||||
|
&& docker-php-ext-enable grpc
|
||||||
|
|
||||||
|
# composer
|
||||||
|
RUN 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
|
||||||
|
|
||||||
|
# swow(安装后默认不加载,使用php -d extension=swow在运行时加载)
|
||||||
|
RUN composer require swow/swow \
|
||||||
|
&& ./vendor/bin/swow-builder --install \
|
||||||
|
&& rm -rf vendor
|
||||||
|
|
||||||
|
RUN apt-get clean
|
||||||
|
|
||||||
|
# 创建应用目录
|
||||||
|
RUN mkdir -p /app
|
||||||
|
|
||||||
|
# 设置工作目录
|
||||||
|
WORKDIR /app
|
@ -1,80 +1,81 @@
|
|||||||
# 拉基础镜像
|
# 拉基础镜像
|
||||||
FROM php:8.2.26-cli
|
FROM php:8.2-cli
|
||||||
|
|
||||||
# 替换源
|
# 替换源
|
||||||
RUN rm /etc/apt/sources.list.d/debian.sources && \
|
RUN rm -rf /etc/apt/sources.list.d/debian.sources \
|
||||||
echo 'deb http://mirror.us.oneandone.net/debian bookworm main' > /etc/apt/sources.list && \
|
&& echo 'deb http://mirror.us.oneandone.net/debian bookworm main' > /etc/apt/sources.list \
|
||||||
echo 'deb-src http://mirror.us.oneandone.net/debian bookworm main' >> /etc/apt/sources.list && \
|
&& echo 'deb-src http://mirror.us.oneandone.net/debian bookworm main' >> /etc/apt/sources.list \
|
||||||
echo 'deb http://mirror.us.oneandone.net/debian-security bookworm-security main' >> /etc/apt/sources.list && \
|
&& apt-get update \
|
||||||
echo 'deb-src http://mirror.us.oneandone.net/debian-security bookworm-security main' >> /etc/apt/sources.list && \
|
&& apt-get install -y netselect-apt \
|
||||||
echo 'deb http://mirror.us.oneandone.net/debian bookworm-updates main' >> /etc/apt/sources.list && \
|
&& netselect-apt --sources bookworm \
|
||||||
echo 'deb-src http://mirror.us.oneandone.net/debian bookworm-updates main' >> /etc/apt/sources.list && \
|
&& mv sources.list /etc/apt/ \
|
||||||
echo 'deb http://mirror.us.oneandone.net/debian bookworm-backports main' >> /etc/apt/sources.list && \
|
&& apt-get update
|
||||||
echo 'deb-src http://mirror.us.oneandone.net/debian bookworm-backports main' >> /etc/apt/sources.list
|
|
||||||
|
|
||||||
# 安装一些依赖
|
|
||||||
RUN apt-get update && apt-get install -y \
|
|
||||||
libfreetype6-dev libjpeg62-turbo-dev \
|
|
||||||
libpng-dev libwebp-dev zlib1g-dev \
|
|
||||||
libzip-dev zip \
|
|
||||||
libevent-dev libssl-dev \
|
|
||||||
lsb-release libpq-dev \
|
|
||||||
libgmp-dev \
|
|
||||||
libmagickwand-dev \
|
|
||||||
libzookeeper-mt-dev \
|
|
||||||
librdkafka-dev \
|
|
||||||
&& apt-get install -y \
|
|
||||||
libprotobuf-dev \
|
|
||||||
&& apt-get install -y \
|
|
||||||
protobuf-compiler \
|
|
||||||
&& apt-get install -y \
|
|
||||||
pkg-config \
|
|
||||||
&& apt-get install -y \
|
|
||||||
git
|
|
||||||
|
|
||||||
# 安装扩展
|
# pcntl socket event
|
||||||
RUN docker-php-ext-configure gd --enable-gd --with-freetype --with-jpeg --with-webp \
|
RUN docker-php-ext-install pcntl sockets \
|
||||||
&& docker-php-ext-install -j$(nproc) gd \
|
&& apt-get install -y libevent-dev \
|
||||||
&& docker-php-ext-install exif \
|
&& printf "no\nyes\n/usr\nno\nyes\nno\nno\nyes\n" | pecl install https://pecl.php.net/get/event-3.1.4.tgz \
|
||||||
&& docker-php-ext-install opcache \
|
|
||||||
&& docker-php-ext-install pdo_mysql \
|
|
||||||
&& docker-php-ext-install mysqli \
|
|
||||||
&& docker-php-ext-install zip \
|
|
||||||
&& docker-php-ext-install pcntl \
|
|
||||||
&& docker-php-ext-install fileinfo \
|
|
||||||
&& pecl install https://pecl.php.net/get/redis-6.1.0.tgz \
|
|
||||||
&& docker-php-ext-enable redis \
|
|
||||||
&& docker-php-ext-install sockets \
|
|
||||||
&& pecl install https://pecl.php.net/get/event-3.1.4.tgz \
|
|
||||||
&& docker-php-ext-enable event \
|
&& docker-php-ext-enable event \
|
||||||
&& cat /usr/local/etc/php/conf.d/docker-php-ext-event.ini >> /usr/local/etc/php/conf.d/docker-php-ext-sockets.ini \
|
&& cat /usr/local/etc/php/conf.d/docker-php-ext-event.ini >> /usr/local/etc/php/conf.d/docker-php-ext-sockets.ini \
|
||||||
&& mv /usr/local/etc/php/conf.d/docker-php-ext-sockets.ini /usr/local/etc/php/conf.d/docker-php-ext-event.ini \
|
&& mv /usr/local/etc/php/conf.d/docker-php-ext-sockets.ini /usr/local/etc/php/conf.d/docker-php-ext-event.ini
|
||||||
&& docker-php-ext-install -j$(nproc) pgsql pdo_pgsql \
|
|
||||||
&& pecl install https://pecl.php.net/get/mongodb-1.19.3.tgz \
|
|
||||||
&& docker-php-ext-enable mongodb \
|
|
||||||
&& docker-php-ext-install -j$(nproc) gmp \
|
|
||||||
&& pecl install https://pecl.php.net/get/imagick-3.7.0.tgz \
|
|
||||||
&& docker-php-ext-enable imagick \
|
|
||||||
&& docker-php-ext-install bcmath \
|
|
||||||
&& docker-php-ext-enable bcmath \
|
|
||||||
&& pecl install https://pecl.php.net/get/xlswriter-1.5.5.tgz \
|
|
||||||
&& docker-php-ext-enable xlswriter \
|
|
||||||
&& pecl install https://pecl.php.net/get/zookeeper-1.2.1.tgz \
|
|
||||||
&& docker-php-ext-enable zookeeper \
|
|
||||||
&& pecl install https://pecl.php.net/get/rdkafka-6.0.3.tgz \
|
|
||||||
&& docker-php-ext-enable rdkafka \
|
|
||||||
# 安装 gRPC 扩展
|
|
||||||
&& pecl install grpc \
|
|
||||||
&& docker-php-ext-enable grpc
|
|
||||||
|
|
||||||
# 安装Composer
|
# pdo_mysql mysqli opcache exif bcmath(任意精度的数学库)
|
||||||
|
RUN docker-php-ext-install pdo_mysql \
|
||||||
|
mysqli \
|
||||||
|
opcache \
|
||||||
|
exif \
|
||||||
|
bcmath
|
||||||
|
|
||||||
|
# gd
|
||||||
|
RUN apt-get install -y \
|
||||||
|
libfreetype6-dev \
|
||||||
|
libjpeg62-turbo-dev \
|
||||||
|
libpng-dev \
|
||||||
|
libwebp-dev \
|
||||||
|
&& docker-php-ext-configure gd --enable-gd --with-freetype --with-jpeg --with-webp \
|
||||||
|
&& docker-php-ext-install -j$(nproc) gd
|
||||||
|
|
||||||
|
# gmp(大整数支持)
|
||||||
|
RUN apt-get install -y libgmp-dev \
|
||||||
|
&& docker-php-ext-install gmp
|
||||||
|
|
||||||
|
# redis
|
||||||
|
RUN printf "no\nno\nno\nno\nno\nyes\n" | pecl install https://pecl.php.net/get/redis-6.1.0.tgz \
|
||||||
|
&& docker-php-ext-enable redis
|
||||||
|
|
||||||
|
# pdo_pgsql pgsql
|
||||||
|
RUN apt-get install -y libpq-dev \
|
||||||
|
&& docker-php-ext-install -j$(nproc) pgsql pdo_pgsql
|
||||||
|
|
||||||
|
# mongodb
|
||||||
|
RUN printf "no\nno\nno\nauto\nauto\nauto\nauto\nauto\nauto\nno\nbundled\n" | pecl install https://pecl.php.net/get/mongodb-1.19.3.tgz \
|
||||||
|
&& docker-php-ext-enable mongodb
|
||||||
|
|
||||||
|
# xlswriter
|
||||||
|
RUN printf "yes\n" | pecl install https://pecl.php.net/get/xlswriter-1.5.5.tgz \
|
||||||
|
&& docker-php-ext-enable xlswriter
|
||||||
|
|
||||||
|
# zip
|
||||||
|
RUN apt-get install -y libzip-dev zip \
|
||||||
|
&& docker-php-ext-install zip
|
||||||
|
|
||||||
|
# protobuf
|
||||||
|
RUN pecl install https://pecl.php.net/get/protobuf-4.29.1.tgz \
|
||||||
|
&& docker-php-ext-enable protobuf
|
||||||
|
|
||||||
|
# composer
|
||||||
RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" \
|
RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" \
|
||||||
&& php composer-setup.php \
|
&& php composer-setup.php \
|
||||||
&& php -r "unlink('composer-setup.php');" \
|
&& php -r "unlink('composer-setup.php');" \
|
||||||
&& mv composer.phar /usr/local/bin/composer
|
&& mv composer.phar /usr/local/bin/composer
|
||||||
|
|
||||||
# 安装swow扩展
|
# swow(安装后默认不加载,使用php -d extension=swow在运行时加载)
|
||||||
# RUN composer require swow/swow && ./vendor/bin/swow-builder --install
|
RUN composer require swow/swow \
|
||||||
|
&& ./vendor/bin/swow-builder --install \
|
||||||
|
&& rm -rf vendor
|
||||||
|
|
||||||
|
RUN apt-get clean
|
||||||
|
|
||||||
# 创建应用目录
|
# 创建应用目录
|
||||||
RUN mkdir -p /app
|
RUN mkdir -p /app
|
||||||
|
89
manual/php/Dockerfile_8.3-grpc
Normal file
89
manual/php/Dockerfile_8.3-grpc
Normal file
@ -0,0 +1,89 @@
|
|||||||
|
# 拉基础镜像
|
||||||
|
FROM php:8.3-cli
|
||||||
|
|
||||||
|
# 替换源
|
||||||
|
RUN rm -rf /etc/apt/sources.list.d/debian.sources \
|
||||||
|
&& echo 'deb http://mirror.us.oneandone.net/debian bookworm main' > /etc/apt/sources.list \
|
||||||
|
&& echo 'deb-src http://mirror.us.oneandone.net/debian bookworm main' >> /etc/apt/sources.list \
|
||||||
|
&& apt-get update \
|
||||||
|
&& apt-get install -y netselect-apt \
|
||||||
|
&& netselect-apt --sources bookworm \
|
||||||
|
&& mv sources.list /etc/apt/ \
|
||||||
|
&& apt-get update
|
||||||
|
|
||||||
|
|
||||||
|
# socket event pcntl
|
||||||
|
RUN docker-php-ext-install sockets \
|
||||||
|
&& apt-get install -y libevent-dev \
|
||||||
|
&& printf "no\nyes\n/usr\nno\nyes\nno\nno\nyes\n" | pecl install https://pecl.php.net/get/event-3.1.4.tgz \
|
||||||
|
&& docker-php-ext-enable event \
|
||||||
|
&& cat /usr/local/etc/php/conf.d/docker-php-ext-event.ini >> /usr/local/etc/php/conf.d/docker-php-ext-sockets.ini \
|
||||||
|
&& mv /usr/local/etc/php/conf.d/docker-php-ext-sockets.ini /usr/local/etc/php/conf.d/docker-php-ext-event.ini \
|
||||||
|
&& docker-php-ext-install pcntl
|
||||||
|
|
||||||
|
# pdo_mysql mysqli opcache exif bcmath(任意精度的数学库)
|
||||||
|
RUN docker-php-ext-install pdo_mysql \
|
||||||
|
mysqli \
|
||||||
|
opcache \
|
||||||
|
exif \
|
||||||
|
bcmath
|
||||||
|
|
||||||
|
# gmp(大整数支持)
|
||||||
|
RUN apt-get install -y libgmp-dev \
|
||||||
|
&& docker-php-ext-install gmp
|
||||||
|
|
||||||
|
# gd
|
||||||
|
RUN apt-get install -y \
|
||||||
|
libfreetype6-dev \
|
||||||
|
libjpeg62-turbo-dev \
|
||||||
|
libpng-dev \
|
||||||
|
libwebp-dev \
|
||||||
|
&& docker-php-ext-configure gd --enable-gd --with-freetype --with-jpeg --with-webp \
|
||||||
|
&& docker-php-ext-install -j$(nproc) gd
|
||||||
|
|
||||||
|
# redis
|
||||||
|
RUN printf "no\nno\nno\nno\nno\nyes\n" | pecl install https://pecl.php.net/get/redis-6.1.0.tgz \
|
||||||
|
&& docker-php-ext-enable redis
|
||||||
|
|
||||||
|
# pdo_pgsql pgsql
|
||||||
|
RUN apt-get install -y libpq-dev \
|
||||||
|
&& docker-php-ext-install -j$(nproc) pgsql pdo_pgsql
|
||||||
|
|
||||||
|
# mongodb
|
||||||
|
RUN printf "no\nno\nno\nauto\nauto\nauto\nauto\nauto\nauto\nno\nbundled\n" | pecl install https://pecl.php.net/get/mongodb-1.19.3.tgz \
|
||||||
|
&& docker-php-ext-enable mongodb
|
||||||
|
|
||||||
|
# xlswriter
|
||||||
|
RUN printf "yes\n" | pecl install https://pecl.php.net/get/xlswriter-1.5.5.tgz \
|
||||||
|
&& docker-php-ext-enable xlswriter
|
||||||
|
|
||||||
|
# zip
|
||||||
|
RUN apt-get install -y libzip-dev zip \
|
||||||
|
&& docker-php-ext-install zip
|
||||||
|
|
||||||
|
# protobuf
|
||||||
|
RUN pecl install https://pecl.php.net/get/protobuf-4.29.1.tgz \
|
||||||
|
&& docker-php-ext-enable protobuf
|
||||||
|
|
||||||
|
# grpc(客户端)
|
||||||
|
RUN pecl install https://pecl.php.net/get/grpc-1.68.0.tgz \
|
||||||
|
&& docker-php-ext-enable grpc
|
||||||
|
|
||||||
|
# composer
|
||||||
|
RUN 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
|
||||||
|
|
||||||
|
# swow(安装后默认不加载,使用php -d extension=swow在运行时加载)
|
||||||
|
RUN composer require swow/swow \
|
||||||
|
&& ./vendor/bin/swow-builder --install \
|
||||||
|
&& rm -rf vendor
|
||||||
|
|
||||||
|
RUN apt-get clean
|
||||||
|
|
||||||
|
# 创建应用目录
|
||||||
|
RUN mkdir -p /app
|
||||||
|
|
||||||
|
# 设置工作目录
|
||||||
|
WORKDIR /app
|
@ -1,74 +1,81 @@
|
|||||||
# 拉基础镜像
|
# 拉基础镜像
|
||||||
FROM php:8.3.14-cli
|
FROM php:8.3-cli
|
||||||
|
|
||||||
# 替换源
|
# 替换源
|
||||||
RUN rm /etc/apt/sources.list.d/debian.sources && \
|
RUN rm -rf /etc/apt/sources.list.d/debian.sources \
|
||||||
echo 'deb http://mirror.us.oneandone.net/debian bookworm main' > /etc/apt/sources.list && \
|
&& echo 'deb http://mirror.us.oneandone.net/debian bookworm main' > /etc/apt/sources.list \
|
||||||
echo 'deb-src http://mirror.us.oneandone.net/debian bookworm main' >> /etc/apt/sources.list && \
|
&& echo 'deb-src http://mirror.us.oneandone.net/debian bookworm main' >> /etc/apt/sources.list \
|
||||||
echo 'deb http://mirror.us.oneandone.net/debian-security bookworm-security main' >> /etc/apt/sources.list && \
|
&& apt-get update \
|
||||||
echo 'deb-src http://mirror.us.oneandone.net/debian-security bookworm-security main' >> /etc/apt/sources.list && \
|
&& apt-get install -y netselect-apt \
|
||||||
echo 'deb http://mirror.us.oneandone.net/debian bookworm-updates main' >> /etc/apt/sources.list && \
|
&& netselect-apt --sources bookworm \
|
||||||
echo 'deb-src http://mirror.us.oneandone.net/debian bookworm-updates main' >> /etc/apt/sources.list && \
|
&& mv sources.list /etc/apt/ \
|
||||||
echo 'deb http://mirror.us.oneandone.net/debian bookworm-backports main' >> /etc/apt/sources.list && \
|
&& apt-get update
|
||||||
echo 'deb-src http://mirror.us.oneandone.net/debian bookworm-backports main' >> /etc/apt/sources.list
|
|
||||||
|
|
||||||
# 安装一些依赖
|
|
||||||
RUN apt-get update && apt-get install -y \
|
|
||||||
libfreetype6-dev libjpeg62-turbo-dev \
|
|
||||||
libpng-dev libwebp-dev zlib1g-dev \
|
|
||||||
libzip-dev zip \
|
|
||||||
libevent-dev libssl-dev \
|
|
||||||
lsb-release libpq-dev \
|
|
||||||
libgmp-dev \
|
|
||||||
librdkafka-dev \
|
|
||||||
&& apt-get install -y \
|
|
||||||
libprotobuf-dev \
|
|
||||||
&& apt-get install -y \
|
|
||||||
protobuf-compiler \
|
|
||||||
&& apt-get install -y \
|
|
||||||
pkg-config \
|
|
||||||
&& apt-get install -y \
|
|
||||||
git
|
|
||||||
|
|
||||||
# 安装扩展
|
# pcntl socket event
|
||||||
RUN docker-php-ext-configure gd --enable-gd --with-freetype --with-jpeg --with-webp \
|
RUN docker-php-ext-install pcntl sockets \
|
||||||
&& docker-php-ext-install -j$(nproc) gd \
|
&& apt-get install -y libevent-dev \
|
||||||
&& docker-php-ext-install exif \
|
&& printf "no\nyes\n/usr\nno\nyes\nno\nno\nyes\n" | pecl install https://pecl.php.net/get/event-3.1.4.tgz \
|
||||||
&& docker-php-ext-install opcache \
|
|
||||||
&& docker-php-ext-install pdo_mysql \
|
|
||||||
&& docker-php-ext-install mysqli \
|
|
||||||
&& docker-php-ext-install zip \
|
|
||||||
&& docker-php-ext-install pcntl \
|
|
||||||
&& docker-php-ext-install fileinfo \
|
|
||||||
&& pecl install https://pecl.php.net/get/redis-6.1.0.tgz \
|
|
||||||
&& docker-php-ext-enable redis \
|
|
||||||
&& docker-php-ext-install sockets \
|
|
||||||
&& pecl install https://pecl.php.net/get/event-3.1.4.tgz \
|
|
||||||
&& docker-php-ext-enable event \
|
&& docker-php-ext-enable event \
|
||||||
&& cat /usr/local/etc/php/conf.d/docker-php-ext-event.ini >> /usr/local/etc/php/conf.d/docker-php-ext-sockets.ini \
|
&& cat /usr/local/etc/php/conf.d/docker-php-ext-event.ini >> /usr/local/etc/php/conf.d/docker-php-ext-sockets.ini \
|
||||||
&& mv /usr/local/etc/php/conf.d/docker-php-ext-sockets.ini /usr/local/etc/php/conf.d/docker-php-ext-event.ini \
|
&& mv /usr/local/etc/php/conf.d/docker-php-ext-sockets.ini /usr/local/etc/php/conf.d/docker-php-ext-event.ini
|
||||||
&& docker-php-ext-install -j$(nproc) pgsql pdo_pgsql \
|
|
||||||
&& pecl install https://pecl.php.net/get/mongodb-1.19.3.tgz \
|
|
||||||
&& docker-php-ext-enable mongodb \
|
|
||||||
&& docker-php-ext-install -j$(nproc) gmp \
|
|
||||||
&& docker-php-ext-install bcmath \
|
|
||||||
&& docker-php-ext-enable bcmath \
|
|
||||||
&& pecl install https://pecl.php.net/get/xlswriter-1.5.5.tgz \
|
|
||||||
&& docker-php-ext-enable xlswriter \
|
|
||||||
&& pecl install https://pecl.php.net/get/rdkafka-6.0.3.tgz \
|
|
||||||
&& docker-php-ext-enable rdkafka \
|
|
||||||
# 安装 gRPC 扩展
|
|
||||||
&& pecl install grpc \
|
|
||||||
&& docker-php-ext-enable grpc
|
|
||||||
|
|
||||||
# 安装Composer
|
# pdo_mysql mysqli opcache exif bcmath(任意精度的数学库)
|
||||||
|
RUN docker-php-ext-install pdo_mysql \
|
||||||
|
mysqli \
|
||||||
|
opcache \
|
||||||
|
exif \
|
||||||
|
bcmath
|
||||||
|
|
||||||
|
# gd
|
||||||
|
RUN apt-get install -y \
|
||||||
|
libfreetype6-dev \
|
||||||
|
libjpeg62-turbo-dev \
|
||||||
|
libpng-dev \
|
||||||
|
libwebp-dev \
|
||||||
|
&& docker-php-ext-configure gd --enable-gd --with-freetype --with-jpeg --with-webp \
|
||||||
|
&& docker-php-ext-install -j$(nproc) gd
|
||||||
|
|
||||||
|
# gmp(大整数支持)
|
||||||
|
RUN apt-get install -y libgmp-dev \
|
||||||
|
&& docker-php-ext-install gmp
|
||||||
|
|
||||||
|
# redis
|
||||||
|
RUN printf "no\nno\nno\nno\nno\nyes\n" | pecl install https://pecl.php.net/get/redis-6.1.0.tgz \
|
||||||
|
&& docker-php-ext-enable redis
|
||||||
|
|
||||||
|
# pdo_pgsql pgsql
|
||||||
|
RUN apt-get install -y libpq-dev \
|
||||||
|
&& docker-php-ext-install -j$(nproc) pgsql pdo_pgsql
|
||||||
|
|
||||||
|
# mongodb
|
||||||
|
RUN printf "no\nno\nno\nauto\nauto\nauto\nauto\nauto\nauto\nno\nbundled\n" | pecl install https://pecl.php.net/get/mongodb-1.19.3.tgz \
|
||||||
|
&& docker-php-ext-enable mongodb
|
||||||
|
|
||||||
|
# xlswriter
|
||||||
|
RUN printf "yes\n" | pecl install https://pecl.php.net/get/xlswriter-1.5.5.tgz \
|
||||||
|
&& docker-php-ext-enable xlswriter
|
||||||
|
|
||||||
|
# zip
|
||||||
|
RUN apt-get install -y libzip-dev zip \
|
||||||
|
&& docker-php-ext-install zip
|
||||||
|
|
||||||
|
# protobuf
|
||||||
|
RUN pecl install https://pecl.php.net/get/protobuf-4.29.1.tgz \
|
||||||
|
&& docker-php-ext-enable protobuf
|
||||||
|
|
||||||
|
# composer
|
||||||
RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" \
|
RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" \
|
||||||
&& php composer-setup.php \
|
&& php composer-setup.php \
|
||||||
&& php -r "unlink('composer-setup.php');" \
|
&& php -r "unlink('composer-setup.php');" \
|
||||||
&& mv composer.phar /usr/local/bin/composer
|
&& mv composer.phar /usr/local/bin/composer
|
||||||
|
|
||||||
# 安装swow扩展
|
# swow(安装后默认不加载,使用php -d extension=swow在运行时加载)
|
||||||
# RUN composer require swow/swow && ./vendor/bin/swow-builder --install
|
RUN composer require swow/swow \
|
||||||
|
&& ./vendor/bin/swow-builder --install \
|
||||||
|
&& rm -rf vendor
|
||||||
|
|
||||||
|
RUN apt-get clean
|
||||||
|
|
||||||
# 创建应用目录
|
# 创建应用目录
|
||||||
RUN mkdir -p /app
|
RUN mkdir -p /app
|
||||||
|
84
manual/php/Dockerfile_8.4-grpc
Normal file
84
manual/php/Dockerfile_8.4-grpc
Normal file
@ -0,0 +1,84 @@
|
|||||||
|
# 拉基础镜像
|
||||||
|
FROM php:8.4-cli
|
||||||
|
|
||||||
|
# 替换源
|
||||||
|
RUN rm -rf /etc/apt/sources.list.d/debian.sources \
|
||||||
|
&& echo 'deb http://mirror.us.oneandone.net/debian bookworm main' > /etc/apt/sources.list \
|
||||||
|
&& echo 'deb-src http://mirror.us.oneandone.net/debian bookworm main' >> /etc/apt/sources.list \
|
||||||
|
&& apt-get update \
|
||||||
|
&& apt-get install -y netselect-apt \
|
||||||
|
&& netselect-apt --sources bookworm \
|
||||||
|
&& mv sources.list /etc/apt/ \
|
||||||
|
&& apt-get update
|
||||||
|
|
||||||
|
|
||||||
|
# socket event pcntl
|
||||||
|
RUN docker-php-ext-install sockets \
|
||||||
|
&& apt-get install -y libevent-dev \
|
||||||
|
&& printf "no\nyes\n/usr\nno\nyes\nno\nno\nyes\n" | pecl install https://pecl.php.net/get/event-3.1.4.tgz \
|
||||||
|
&& docker-php-ext-enable event \
|
||||||
|
&& cat /usr/local/etc/php/conf.d/docker-php-ext-event.ini >> /usr/local/etc/php/conf.d/docker-php-ext-sockets.ini \
|
||||||
|
&& mv /usr/local/etc/php/conf.d/docker-php-ext-sockets.ini /usr/local/etc/php/conf.d/docker-php-ext-event.ini \
|
||||||
|
&& docker-php-ext-install pcntl
|
||||||
|
|
||||||
|
# pdo_mysql mysqli opcache exif bcmath(任意精度的数学库)
|
||||||
|
RUN docker-php-ext-install pdo_mysql \
|
||||||
|
mysqli \
|
||||||
|
opcache \
|
||||||
|
exif \
|
||||||
|
bcmath
|
||||||
|
|
||||||
|
# gmp(大整数支持)
|
||||||
|
RUN apt-get install -y libgmp-dev \
|
||||||
|
&& docker-php-ext-install gmp
|
||||||
|
|
||||||
|
# gd
|
||||||
|
RUN apt-get install -y \
|
||||||
|
libfreetype6-dev \
|
||||||
|
libjpeg62-turbo-dev \
|
||||||
|
libpng-dev \
|
||||||
|
libwebp-dev \
|
||||||
|
&& docker-php-ext-configure gd --enable-gd --with-freetype --with-jpeg --with-webp \
|
||||||
|
&& docker-php-ext-install -j$(nproc) gd
|
||||||
|
|
||||||
|
# redis
|
||||||
|
RUN printf "no\nno\nno\nno\nno\nyes\n" | pecl install https://pecl.php.net/get/redis-6.1.0.tgz \
|
||||||
|
&& docker-php-ext-enable redis
|
||||||
|
|
||||||
|
# pdo_pgsql pgsql
|
||||||
|
RUN apt-get install -y libpq-dev \
|
||||||
|
&& docker-php-ext-install -j$(nproc) pgsql pdo_pgsql
|
||||||
|
|
||||||
|
# mongodb
|
||||||
|
RUN printf "no\nno\nno\nauto\nauto\nauto\nauto\nauto\nauto\nno\nbundled\n" | pecl install https://pecl.php.net/get/mongodb-1.19.3.tgz \
|
||||||
|
&& docker-php-ext-enable mongodb
|
||||||
|
|
||||||
|
# xlswriter
|
||||||
|
RUN printf "yes\n" | pecl install https://pecl.php.net/get/xlswriter-1.5.5.tgz \
|
||||||
|
&& docker-php-ext-enable xlswriter
|
||||||
|
|
||||||
|
# zip
|
||||||
|
RUN apt-get install -y libzip-dev zip \
|
||||||
|
&& docker-php-ext-install zip
|
||||||
|
|
||||||
|
# protobuf
|
||||||
|
RUN pecl install https://pecl.php.net/get/protobuf-4.29.1.tgz \
|
||||||
|
&& docker-php-ext-enable protobuf
|
||||||
|
|
||||||
|
# grpc(客户端)
|
||||||
|
RUN pecl install https://pecl.php.net/get/grpc-1.68.0.tgz \
|
||||||
|
&& docker-php-ext-enable grpc
|
||||||
|
|
||||||
|
# composer
|
||||||
|
RUN 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
|
||||||
|
|
||||||
|
RUN apt-get clean
|
||||||
|
|
||||||
|
# 创建应用目录
|
||||||
|
RUN mkdir -p /app
|
||||||
|
|
||||||
|
# 设置工作目录
|
||||||
|
WORKDIR /app
|
80
manual/php/Dockerfile_8.4-workerman
Normal file
80
manual/php/Dockerfile_8.4-workerman
Normal file
@ -0,0 +1,80 @@
|
|||||||
|
# 拉基础镜像
|
||||||
|
FROM php:8.4-cli
|
||||||
|
|
||||||
|
# 替换源
|
||||||
|
RUN rm -rf /etc/apt/sources.list.d/debian.sources \
|
||||||
|
&& echo 'deb http://mirror.us.oneandone.net/debian bookworm main' > /etc/apt/sources.list \
|
||||||
|
&& echo 'deb-src http://mirror.us.oneandone.net/debian bookworm main' >> /etc/apt/sources.list \
|
||||||
|
&& apt-get update \
|
||||||
|
&& apt-get install -y netselect-apt \
|
||||||
|
&& netselect-apt --sources bookworm \
|
||||||
|
&& mv sources.list /etc/apt/ \
|
||||||
|
&& apt-get update
|
||||||
|
|
||||||
|
|
||||||
|
# socket event pcntl
|
||||||
|
RUN docker-php-ext-install sockets \
|
||||||
|
&& apt-get install -y libevent-dev \
|
||||||
|
&& printf "no\nyes\n/usr\nno\nyes\nno\nno\nyes\n" | pecl install https://pecl.php.net/get/event-3.1.4.tgz \
|
||||||
|
&& docker-php-ext-enable event \
|
||||||
|
&& cat /usr/local/etc/php/conf.d/docker-php-ext-event.ini >> /usr/local/etc/php/conf.d/docker-php-ext-sockets.ini \
|
||||||
|
&& mv /usr/local/etc/php/conf.d/docker-php-ext-sockets.ini /usr/local/etc/php/conf.d/docker-php-ext-event.ini \
|
||||||
|
&& docker-php-ext-install pcntl
|
||||||
|
|
||||||
|
# pdo_mysql mysqli opcache exif bcmath(任意精度的数学库)
|
||||||
|
RUN docker-php-ext-install pdo_mysql \
|
||||||
|
mysqli \
|
||||||
|
opcache \
|
||||||
|
exif \
|
||||||
|
bcmath
|
||||||
|
|
||||||
|
# gmp(大整数支持)
|
||||||
|
RUN apt-get install -y libgmp-dev \
|
||||||
|
&& docker-php-ext-install gmp
|
||||||
|
|
||||||
|
# gd
|
||||||
|
RUN apt-get install -y \
|
||||||
|
libfreetype6-dev \
|
||||||
|
libjpeg62-turbo-dev \
|
||||||
|
libpng-dev \
|
||||||
|
libwebp-dev \
|
||||||
|
&& docker-php-ext-configure gd --enable-gd --with-freetype --with-jpeg --with-webp \
|
||||||
|
&& docker-php-ext-install -j$(nproc) gd
|
||||||
|
|
||||||
|
# redis
|
||||||
|
RUN printf "no\nno\nno\nno\nno\nyes\n" | pecl install https://pecl.php.net/get/redis-6.1.0.tgz \
|
||||||
|
&& docker-php-ext-enable redis
|
||||||
|
|
||||||
|
# pdo_pgsql pgsql
|
||||||
|
RUN apt-get install -y libpq-dev \
|
||||||
|
&& docker-php-ext-install -j$(nproc) pgsql pdo_pgsql
|
||||||
|
|
||||||
|
# mongodb
|
||||||
|
RUN printf "no\nno\nno\nauto\nauto\nauto\nauto\nauto\nauto\nno\nbundled\n" | pecl install https://pecl.php.net/get/mongodb-1.19.3.tgz \
|
||||||
|
&& docker-php-ext-enable mongodb
|
||||||
|
|
||||||
|
# xlswriter
|
||||||
|
RUN printf "yes\n" | pecl install https://pecl.php.net/get/xlswriter-1.5.5.tgz \
|
||||||
|
&& docker-php-ext-enable xlswriter
|
||||||
|
|
||||||
|
# zip
|
||||||
|
RUN apt-get install -y libzip-dev zip \
|
||||||
|
&& docker-php-ext-install zip
|
||||||
|
|
||||||
|
# protobuf
|
||||||
|
RUN pecl install https://pecl.php.net/get/protobuf-4.29.1.tgz \
|
||||||
|
&& docker-php-ext-enable protobuf
|
||||||
|
|
||||||
|
# composer
|
||||||
|
RUN 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
|
||||||
|
|
||||||
|
RUN apt-get clean
|
||||||
|
|
||||||
|
# 创建应用目录
|
||||||
|
RUN mkdir -p /app
|
||||||
|
|
||||||
|
# 设置工作目录
|
||||||
|
WORKDIR /app
|
31
manual/php/buildx.sh
Executable file
31
manual/php/buildx.sh
Executable file
@ -0,0 +1,31 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Create a build log file
|
||||||
|
LOG_FILE="build.log"
|
||||||
|
|
||||||
|
# Function to log messages with timestamps
|
||||||
|
log_message() {
|
||||||
|
echo "$(date '+%Y-%m-%d %H:%M:%S') - \$1" >> "$LOG_FILE"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Create a new buildx builder and use it
|
||||||
|
docker buildx create --use
|
||||||
|
|
||||||
|
# Array of PHP versions and types
|
||||||
|
declare -a PHP_VERSIONS=("8.1" "8.2" "8.3" "8.4")
|
||||||
|
declare -a BUILD_TYPES=("workerman" "grpc")
|
||||||
|
|
||||||
|
# Loop through each PHP version and build type
|
||||||
|
for VERSION in "${PHP_VERSIONS[@]}"; do
|
||||||
|
for TYPE in "${BUILD_TYPES[@]}"; do
|
||||||
|
IMAGE_TAG="quay.io/wandoubaba517/php:${VERSION}-${TYPE}"
|
||||||
|
DOCKERFILE="Dockerfile_${VERSION}-${TYPE}"
|
||||||
|
|
||||||
|
# Build the Docker image
|
||||||
|
if docker buildx build --platform linux/amd64,linux/arm64 --push -t "$IMAGE_TAG" -f "$DOCKERFILE" .; then
|
||||||
|
log_message "SUCCESS: Built and pushed $IMAGE_TAG"
|
||||||
|
else
|
||||||
|
log_message "FAILURE: Failed to build $IMAGE_TAG"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
done
|
Loading…
Reference in New Issue
Block a user