Skip to content

Commit d24cbfb

Browse files
committed
PHP 8.1 RC5.
1 parent 3acddc5 commit d24cbfb

File tree

2 files changed

+27
-37
lines changed

2 files changed

+27
-37
lines changed

docker/images/base-php8/Dockerfile

Lines changed: 27 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,39 @@
11
# phpexperts/php:7
2-
FROM ubuntu:focal as intermediate
2+
FROM phpexperts/linux:latest AS intermediate
33
#FROM phpexperts/php:8.0-temp
44

5-
ARG PHP_VERSION=8.0
5+
ARG PHP_VERSION=8.1
66

77
# Fix add-apt-repository is broken with non-UTF-8 locales, see https://github.com/oerdnj/deb.sury.org/issues/56
88
ENV LC_ALL C.UTF-8
99
ENV DEBIAN_FRONTEND noninteractive
1010

11-
RUN apt-get update && \
12-
# Configure ondrej PPA
13-
apt-get install -y software-properties-common && \
14-
apt-get upgrade -y && \
15-
#
16-
# Install PHP & curl (for composer)
17-
apt-get install -y --no-install-recommends \
18-
curl \
19-
less vim inetutils-ping unzip net-tools && \
20-
#
21-
# Compile PHP 8 manuall
22-
apt-get install -y --no-install-recommends gcc g++ make && \
11+
# Compile PHP 8.1 manually
12+
RUN apt-get install -y --no-install-recommends gcc g++ make && \
2313
apt-get install -y libxml2-dev libcurl4-openssl-dev libjpeg-dev libpng-dev \
2414
libmysqlclient-dev libpq-dev libicu-dev libfreetype6-dev \
2515
libxslt-dev libssl-dev libldb-dev libedit-dev libsodium-dev \
2616
zlibc zlib1g zlib1g-dev libsqlite3-dev libgmp-dev libzip-dev \
2717
libonig-dev binutils && \
2818
#
29-
curl https://downloads.php.net/~carusogabriel/php-8.0.0RC3.tar.xz -o php.xz && \
19+
curl https://downloads.php.net/~patrickallaert/php-8.1.0RC5.tar.xz -o php.xz && \
3020
tar xvf php.xz && \
31-
cd php-8.0.0RC3 && \
21+
cd php-8.1.0RC5 && \
3222
# Build CLI
3323
./configure --enable-mbstring --with-pdo-mysql --with-pdo-pgsql --enable-mysqlnd \
3424
--enable-gd --with-gmp --enable-bcmath --with-curl --with-zip --with-openssl \
35-
--enable-sockets --with-libedit --with-sodium --enable-exif --enable-intl \
25+
--enable-sockets --disable-phpdbg --with-libedit --with-sodium --enable-exif --enable-intl \
3626
--with-mysqli --with-xsl --with-zlib --prefix=/workdir/install/usr \
37-
--with-config-file-path=/etc/php/8.0/cli --with-config-file-scan-dir=/etc/php/8.0/cli/conf.d && \
27+
--with-config-file-path=/etc/php/8.1/cli --with-config-file-scan-dir=/etc/php/8.1/cli/conf.d && \
3828
make -j8 && \
3929
make install && \
4030
# Build FPM
4131
./configure --enable-mbstring --with-pdo-mysql --with-pdo-pgsql --enable-mysqlnd \
4232
--enable-gd --with-gmp --enable-bcmath --with-curl --with-zip --with-openssl \
43-
--enable-sockets --with-libedit --with-sodium --enable-exif --enable-intl \
33+
--enable-sockets --disable-phpdbg --with-libedit --with-sodium --enable-exif --enable-intl \
4434
--with-mysqli --with-xsl --with-zlib \
4535
--enable-fpm --with-fpm-user=www-data --enable-pcntl --prefix=/workdir/install/usr \
46-
--with-config-file-path=/etc/php/8.0/fpm --with-config-file-scan-dir=/etc/php/8.0/fpm/conf.d && \
36+
--with-config-file-path=/etc/php/8.1/fpm --with-config-file-scan-dir=/etc/php/8.1/fpm/conf.d && \
4737
make -j8 && \
4838
make install && \
4939
#
@@ -52,21 +42,21 @@ RUN apt-get update && \
5242
mkdir -p /workdir/install/etc/php/${PHP_VERSION}/cli/conf.d && \
5343
mkdir -p /workdir/install/etc/php/${PHP_VERSION}/fpm/conf.d && \
5444
mkdir -p /workdir/install/etc/php/${PHP_VERSION}/fpm/pool.d && \
55-
cd /php-8.0.0RC3 && \
45+
#cd /php-8.1.0RC5 && \
5646
cp -v php.ini-development /workdir/install/etc/php/${PHP_VERSION}/cli/php.ini && \
5747
cp -v php.ini-development /workdir/install/etc/php/${PHP_VERSION}/fpm/php.ini && \
5848
cp -v ./sapi/fpm/php-fpm.conf /workdir/install/etc/php/${PHP_VERSION}/fpm/ && \
59-
cp -v ./sapi/fpm/www.conf /workdir/install/etc/php/${PHP_VERSION}/fpm/pool.d && \
49+
cp -v ./sapi/fpm/www.conf /workdir/install/etc/php/${PHP_VERSION}/fpm/pool.d
6050
#
6151
## Fix the extension_dir path (screwed up from --prefix=/workdir/install/usr):
62-
echo extension_dir=$(/workdir/install/usr/bin/php --info | grep ^extension_dir | awk '{print $3}' | sed 's#/workdir/install##') >> /workdir/install/etc/php/${PHP_VERSION}/cli/php.ini && \
52+
RUN echo extension_dir=$(/workdir/install/usr/bin/php --info | grep ^extension_dir | awk '{print $3}' | sed 's#/workdir/install##') >> /workdir/install/etc/php/${PHP_VERSION}/cli/php.ini && \
6353
echo extension_dir=$(/workdir/install/usr/bin/php --info | grep ^extension_dir | awk '{print $3}' | sed 's#/workdir/install##') >> /workdir/install/etc/php/${PHP_VERSION}/fpm/php.ini && \
6454
sed -i 's#/workdir/install##' /workdir/install/usr/bin/phpize && \
6555
#
66-
## Strip the PHP binaries to dramatically reduce the image size (583 MB to 156 MB).
67-
strip /workdir/install/usr/bin/php /workdir/install/usr/sbin/php-fpm && \
6856
## Remove the worthless php-cgi and save 64 MB.
6957
rm /workdir/install/usr/bin/php-cgi && \
58+
## Strip the PHP binaries to dramatically reduce the image size (583 MB to 156 MB).
59+
strip -v /workdir/install/usr/bin/php /workdir/install/usr/sbin/php-fpm && \
7060
#
7161
## Install PHP so that the build programs will work.
7262
cp -avf /workdir/install/* / && \
@@ -109,39 +99,40 @@ RUN apt-get update && \
10999

110100
WORKDIR /workdir
111101

112-
FROM ubuntu:focal
102+
ENTRYPOINT ["/usr/bin/bash", "-l"]
113103

114-
ARG PHP_VERSION=8.0
104+
FROM phpexperts/linux:latest
105+
106+
ARG PHP_VERSION=8.1
115107

116108
# Fix add-apt-repository is broken with non-UTF-8 locales, see https://github.com/oerdnj/deb.sury.org/issues/56
117109
ENV LC_ALL C.UTF-8
118110
ENV DEBIAN_FRONTEND noninteractive
119111

120-
COPY --from=intermediate /workdir/php-8.0-ubuntu.tar.gz /php-8.0-ubuntu.tar.gz
112+
COPY --from=intermediate /workdir/php-8.1-ubuntu.tar.gz /php-8.1-ubuntu.tar.gz
121113

122114
RUN apt-get update && \
123115
# Configure ondrej PPA
124116
apt-get install -y software-properties-common && \
125117
apt-get upgrade -y && \
126118
#
127119
# Install PHP & curl (for composer)
128-
apt-get install -y --no-install-recommends \
129-
curl \
130-
less vim inetutils-ping unzip net-tools && \
131120
# Install PHP extension dependencies
132-
apt-get install -y libpq5 libpng16-16 libonig5 libzip5 libxslt-dev zlibc zlib1g libsodium-dev libedit-dev && \
121+
apt-get install -y libpq5 libpng16-16 libonig5 libxslt-dev zlibc zlib1g libsodium-dev libedit-dev libcurl4 libzip4 && \
133122
#
134123
# Cleanup
135124
apt-get remove -y && \
136125
apt-get autoremove -y && \
137126
apt-get clean && \
138-
rm -rf /var/lib/apt/lists/* && \
139-
tar xvf php-8.0-ubuntu.tar.gz && \
140-
rm -v php-8.0-ubuntu.tar.gz
127+
# rm -rf /var/lib/apt/lists/* && \
128+
cd / && \
129+
tar xvf php-8.1-ubuntu.tar.gz && \
130+
rm -v php-8.1-ubuntu.tar.gz && \
131+
echo "Finished..."
141132

142-
VOLUME ["/workdir"]
143133
WORKDIR /workdir
144134

145135
COPY entrypoint.sh /usr/local/bin/entrypoint-php.sh
146136

147137
ENTRYPOINT ["/usr/local/bin/entrypoint-php.sh"]
138+

docker/images/linux/Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ RUN echo "Building base Linux..." && \
2626
curl git ssh \
2727
less vim inetutils-ping zip unzip net-tools
2828

29-
VOLUME ["/workdir"]
3029
WORKDIR /workdir
3130

3231
ENTRYPOINT ["bash", "-l"]

0 commit comments

Comments
 (0)