This commit is contained in:
zyimm 2023-08-04 17:57:21 +08:00
parent 1cd0116796
commit 04ee12d00a
19 changed files with 2135 additions and 0 deletions

View File

@ -0,0 +1,104 @@
ARG ALPINE_VERSION=3.18
ARG PHP_VERSION=8.2
FROM php:${PHP_VERSION}-fpm-alpine${ALPINE_VERSION}
LABEL maintainer="zyimm@qq.com" version="1.0" license="MIT"
ENV PHPIZE_DEPS="autoconf dpkg-dev dpkg file g++ gcc make php82-dev php82-pear pkgconf re2c pcre-dev pcre2-dev automake linux-headers libevent-dev"
# 中科大镜像
ARG CONTAINER_PACKAGE_URL=mirrors.ustc.edu.cn
RUN if [ $CONTAINER_PACKAGE_URL ] ; then sed -i "s/dl-cdn.alpinelinux.org/${CONTAINER_PACKAGE_URL}/g" /etc/apk/repositories ; fi
ARG TZ=Asia/Shanghai
RUN set -ex \
&& apk --no-cache add tzdata \
&& cp "/usr/share/zoneinfo/$TZ" /etc/localtime \
&& echo "$TZ" > /etc/timezone
# Install composer and change it's cache home
RUN curl -o /usr/bin/composer https://mirrors.aliyun.com/composer/composer.phar \
&& chmod +x /usr/bin/composer \
&& composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/
ENV COMPOSER_HOME=/tmp/composer
COPY ./extensions /tmp/extensions
WORKDIR /tmp/extensions
RUN set -ex \
&& apk update \
&& apk add --no-cache libstdc++ openssl bash c-ares-dev libpq-dev libc-dev libaio-dev openssl-dev curl-dev zlib-dev \
&& apk add --no-cache --virtual .build-deps $PHPIZE_DEPS \
&& mv *.so /usr/local/lib/php/extensions/no-debug-non-zts-20220829/ \
#Install redis
&& docker-php-ext-enable igbinary \
&& docker-php-ext-enable redis \
&& docker-php-ext-enable redis \
&& docker-php-ext-enable mongodb \
&& docker-php-ext-enable pdo_mysql \
&& docker-php-ext-enable bcmath \
&& docker-php-ext-enable exif \
&& docker-php-ext-enable calendar \
&& set -ex \
&& unzip swoole-src-5.0.3.zip && cd swoole-src-5.0.3 \
&& phpize \
&& ./configure --enable-openssl --enable-swoole-curl --enable-cares --enable-swoole-pgsql \
&& make -s -j$(nproc) && make install \
&& docker-php-ext-enable swoole && cd ../ && rm -rf swoole-src-5.0.3 \
#Install redis
# && pecl install igbinary && docker-php-ext-enable igbinary \
# && pecl install redis \
# && docker-php-ext-enable redis \
# && pecl install mongodb && docker-php-ext-enable mongodb \
# && docker-php-ext-install -j$(nproc) pdo_mysql \
&& docker-php-ext-install -j$(nproc) sockets \
# && docker-php-ext-install -j$(nproc) bcmath \
# && docker-php-ext-install -j$(nproc) exif \
# && docker-php-ext-install -j$(nproc) calendar \
#Install pcntl
&& docker-php-ext-install -j$(nproc) pcntl \
# #Install protobuf
# && pecl install protobuf && docker-php-ext-enable protobuf \
#Insatll zip
# && apk add --no-cache libzip-dev \
# && docker-php-ext-install -j$(nproc) zip \
#Install imagick
&& apk add --no-cache imagemagick-dev libtool \
# && pecl install imagick \
&& docker-php-ext-enable imagick \
#Install gd
&& apk add --no-cache \
freetype \
freetype-dev \
libpng \
libpng-dev \
libjpeg-turbo \
libjpeg-turbo-dev \
libwebp-dev \
# && docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp \
# && docker-php-ext-install -j$(nproc) gd \
&& apk del \
freetype-dev \
libpng-dev \
libjpeg-turbo-dev \
&& docker-php-ext-enable gd \
#Install event
&& pecl install event && docker-php-ext-enable event \
&& mv /usr/local/etc/php/conf.d/docker-php-ext-event.ini /usr/local/etc/php/conf.d/docker-php-ext-z-event.ini \
&& apk del autoconf dpkg-dev dpkg file g++ gcc make automake \
&& rm -rf /var/cache/apk/* /tmp/*
#RUN apk --no-cache add shadow && usermod -u 1000 www-data && groupmod -g 1000 www-data
COPY ./php.ini /usr/local/etc/php/php.ini
# ---------- clear ----------
RUN set -x \
&& rm -rf /var/cache/apk/* /tmp/*
WORKDIR /www

View File

@ -0,0 +1,96 @@
ARG ALPINE_VERSION=3.18
ARG PHP_VERSION=8.2
FROM php:${PHP_VERSION}-fpm-alpine${ALPINE_VERSION}
LABEL maintainer="zyimm@qq.com" version="1.0" license="MIT"
ENV PHPIZE_DEPS="autoconf dpkg-dev dpkg file g++ gcc make php82-dev php82-pear pkgconf re2c pcre-dev pcre2-dev automake linux-headers"
# 中科大镜像
ARG CONTAINER_PACKAGE_URL=mirrors.ustc.edu.cn
RUN if [ $CONTAINER_PACKAGE_URL ] ; then sed -i "s/dl-cdn.alpinelinux.org/${CONTAINER_PACKAGE_URL}/g" /etc/apk/repositories ; fi
ARG TZ=Asia/Shanghai
RUN set -ex \
&& apk --no-cache add tzdata \
&& cp "/usr/share/zoneinfo/$TZ" /etc/localtime \
&& echo "$TZ" > /etc/timezone
# Install composer and change it's cache home
RUN curl -o /usr/bin/composer https://mirrors.aliyun.com/composer/composer.phar \
&& chmod +x /usr/bin/composer \
&& composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/
ENV COMPOSER_HOME=/tmp/composer
COPY ./extensions /tmp/extensions
WORKDIR /tmp/extensions
RUN set -ex \
&& apk update \
&& apk add --no-cache libstdc++ openssl bash c-ares-dev libpq-dev libc-dev libaio-dev openssl-dev curl-dev zlib-dev \
&& apk add --no-cache --virtual .build-deps $PHPIZE_DEPS \
&& set -ex \
&& unzip swoole-src-5.0.3.zip && cd swoole-src-5.0.3 \
&& phpize \
&& ./configure --enable-openssl --enable-swoole-curl --enable-cares --enable-swoole-pgsql \
&& make -s -j$(nproc) && make install \
&& docker-php-ext-enable swoole && cd ../ && rm -rf swoole-src-5.0.3 \
#Install redis
&& pecl install igbinary && docker-php-ext-enable igbinary \
&& pecl install redis \
&& docker-php-ext-enable redis \
&& pecl install mongodb && docker-php-ext-enable mongodb \
&& docker-php-ext-install -j$(nproc) pdo_mysql \
&& docker-php-ext-install -j$(nproc) sockets \
&& docker-php-ext-install -j$(nproc) bcmath \
&& docker-php-ext-install -j$(nproc) exif \
&& docker-php-ext-install -j$(nproc) calendar \
#Install pcntl
&& docker-php-ext-install -j$(nproc) pcntl \
# #Install protobuf
&& pecl install protobuf && docker-php-ext-enable protobuf \
#Insatll zip
&& apk add --no-cache libzip-dev \
&& docker-php-ext-install -j$(nproc) zip \
#Install imagick
&& apk add --no-cache imagemagick-dev libtool \
&& pecl install imagick \
&& docker-php-ext-enable imagick \
#Install gd
&& apk add --no-cache \
freetype \
freetype-dev \
libpng \
libpng-dev \
libjpeg-turbo \
libjpeg-turbo-dev \
libwebp-dev \
&& docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp \
&& docker-php-ext-install -j$(nproc) gd \
&& apk del \
freetype-dev \
libpng-dev \
libjpeg-turbo-dev \
#Install event
&& apk add --no-cache libevent-dev \
&& mkdir event && tar -xvf /tmp/extensions/event-3.0.5.tgz && cd event-3.0.5/ \
&& phpize && ./configure && make -j$(nproc) && make install \
&& docker-php-ext-enable event && cd ../ && rm -rf event-3.0.5 \
&& mv /usr/local/etc/php/conf.d/docker-php-ext-event.ini /usr/local/etc/php/conf.d/docker-php-ext-z-event.ini \
#&& apk del .build-deps \
&& rm -rf /var/cache/apk/* /tmp/*
#RUN apk --no-cache add shadow && usermod -u 1000 www-data && groupmod -g 1000 www-data
COPY ./php.ini /usr/local/etc/php/php.ini
# ---------- clear ----------
RUN set -x \
&& rm -rf /var/cache/apk/* /tmp/*
WORKDIR /www

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

1935
php8.2-swoole-alpine/php.ini Normal file

File diff suppressed because it is too large Load Diff