Skip to content

Commit

Permalink
php 8.2 support
Browse files Browse the repository at this point in the history
  • Loading branch information
terryzwt committed May 24, 2023
1 parent a1938b6 commit cf642a1
Show file tree
Hide file tree
Showing 4 changed files with 134 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ jobs:
- tag: 8.1
Dockerfile: "8.1/Dockerfile"
image: "davyinsa/cloudrup-webserver:8.1"
- tag: 8.2
Dockerfile: "8.2/Dockerfile"
image: "davyinsa/cloudrup-webserver:8.2"
- tag: 7.1-oci8
Dockerfile: "7.1/oci8/Dockerfile"
image: "davyinsa/cloudrup-webserver:7.1-oci8"
Expand Down
100 changes: 100 additions & 0 deletions 8.2/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
FROM davyinsa/cloudrup-static-server
ENV TERM="xterm" \
LANG="C.UTF-8" \
LC_ALL="C.UTF-8" \
DEBIAN_FRONTEND="noninteractive" \
COMPOSER1_VERSION=1.10.26 \
PHPREDIS_VERSION=5.3.7 \
DRUSH_VERSION=8.4.11 \
OPENSSL_VERSION=1.1.1q \
PHP_VERSION=8.2

RUN apt-get update -qq && \
apt-get install -y software-properties-common && \
apt-add-repository -y ppa:ondrej/php && \
apt-get update -qq && apt-get install -y -qq \
php$PHP_VERSION \
php$PHP_VERSION-dev \
libapache2-mod-php$PHP_VERSION \
php$PHP_VERSION-cli \
php$PHP_VERSION-opcache \
php-json \
\
php$PHP_VERSION-curl \
php$PHP_VERSION-ldap \
php$PHP_VERSION-bz2 \
php$PHP_VERSION-cgi \
php$PHP_VERSION-soap \
php$PHP_VERSION-common \
php$PHP_VERSION-mbstring \
php$PHP_VERSION-gd \
php$PHP_VERSION-intl \
php$PHP_VERSION-xml \
php$PHP_VERSION-mysql \
php$PHP_VERSION-zip \
php$PHP_VERSION-bcmath \
php-redis \
sudo \
rsync \
git-core \
unzip \
wget \
mariadb-client \
vim \
build-essential \
checkinstall \
zlib1g-dev \
curl && \
# Install redis extension
update-alternatives --set php /usr/bin/php$PHP_VERSION && \
cd /tmp && \
git clone --branch $PHPREDIS_VERSION https://github.com/phpredis/phpredis && \
cd phpredis && \
phpize && \
./configure && \
make && \
make install && \
rm -rf /tmp/phpredis && \
echo "extension=redis.so" > /etc/php/$PHP_VERSION/mods-available/redis.ini && \
ln -s /etc/php/$PHP_VERSION/mods-available/redis.ini /etc/php/$PHP_VERSION/apache2/conf.d/30-redis.ini && \
ln -s /etc/php/$PHP_VERSION/mods-available/redis.ini /etc/php/$PHP_VERSION/cli/conf.d/30-redis.ini && \
rm -rf /var/lib/apt/lists/* && \
## set /var/www dir AllowOverride => All
sed -i "170,174s/AllowOverride None/AllowOverride All/g" /etc/apache2/apache2.conf && \
## install composer
wget https://getcomposer.org/installer -O - -q > /tmp/composer-setup.php && \
php /tmp/composer-setup.php --install-dir=/usr/local/bin --filename=composer && \
php -r "unlink('/tmp/composer-setup.php');" && \
chmod +x /usr/local/bin/composer && \
## install drush
wget https://github.com/drush-ops/drush/releases/download/${DRUSH_VERSION}/drush.phar -O - -q > /usr/local/bin/drush && \
chmod +x /usr/local/bin/drush && \
## install latest openssl
cd /usr/local/src/ && \
curl https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz -o openssl-${OPENSSL_VERSION}.tar.gz && \
tar -xf openssl-${OPENSSL_VERSION}.tar.gz && \
cd /usr/local/src/openssl-${OPENSSL_VERSION} && \
./config --prefix=/usr/local/ssl --openssldir=/usr/local/ssl shared zlib && \
make && \
make test && \
make install && \
cd /etc/ld.so.conf.d/ && \
echo "/usr/local/ssl/lib" > openssl-${OPENSSL_VERSION}.conf && \
ldconfig -v && \
rm /usr/bin/c_rehash && \
rm /usr/bin/openssl && \
rm /usr/local/src/openssl-${OPENSSL_VERSION}.tar.gz && \
rm -rf /usr/local/src/openssl-${OPENSSL_VERSION} && \
apt-get remove -y build-essential checkinstall zlib1g-dev && \
apt-get autoremove -y && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
ENV \
PATH=/usr/local/ssl/bin:$PATH \
SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt \
SSL_CERT_DIR=/etc/ssl/certs
COPY rootfs /
#USER aegir
WORKDIR /var/aegir
VOLUME /var/aegir
EXPOSE 22 80 443
29 changes: 29 additions & 0 deletions 8.2/oci8/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
## https://hub.docker.com/r/adrianharabula/php7-with-oci8/dockerfile
FROM davyinsa/cloudrup-webserver:8.2
USER root
RUN apt-get -qq update && apt install -y curl unzip libaio1 php8.1-xml && \
cd /tmp && \
curl -L https://raw.github.com/adrianharabula/php7-with-oci8/master/instantclient/19.3.0.0.0/instantclient-basiclite-linux.x64-19.3.0.0.0dbru.zip -O && \
curl -L https://raw.github.com/adrianharabula/php7-with-oci8/master/instantclient/19.3.0.0.0/instantclient-sdk-linux.x64-19.3.0.0.0dbru.zip -O && \
curl -L https://raw.github.com/adrianharabula/php7-with-oci8/master/instantclient/19.3.0.0.0/instantclient-sqlplus-linux.x64-19.3.0.0.0dbru.zip -O && \
unzip /tmp/instantclient-basiclite-linux.x64-19.3.0.0.0dbru.zip -d /usr/local/ && \
unzip /tmp/instantclient-sdk-linux.x64-19.3.0.0.0dbru.zip -d /usr/local/ && \
unzip /tmp/instantclient-sqlplus-linux.x64-19.3.0.0.0dbru.zip -d /usr/local/ && \
rm /tmp/*.zip && \
ln -s /usr/local/instantclient_19_3 /usr/local/instantclient && \
# fixes error "libnnz19.so: cannot open shared object file: No such file or directory"
ln -s /usr/local/instantclient/lib* /usr/lib && \
ln -s /usr/local/instantclient/sqlplus /usr/bin/sqlplus && \
export LD_LIBRARY_PATH="/usr/local/instantclient" && \
echo 'instantclient,/usr/local/instantclient' | pecl install oci8-2.2.0 && \
# install pdo_oci / https://github.com/rosemberg-al/docker-php7-pdo_oci-oci8/blob/master/Dockerfile
git clone -b PHP-8.2 https://github.com/php/php-src.git /tmp/php-src && \
cd /tmp/php-src/ext/pdo_oci/ && \
phpize && \
./configure --with-pdo-oci=instantclient,/usr/local/instantclient && \
make install && \
echo "extension=oci8.so" > /etc/php/8.2/apache2/conf.d/php-oci.ini && \
echo "extension=oci8.so" > /etc/php/8.2/cli/conf.d/php-oci.ini && \
echo "extension=pdo_oci.so" > /etc/php/8.2/apache2/conf.d/pdo_oci.ini && \
echo "extension=pdo_oci.so" > /etc/php/8.2/cli/conf.d/pdo_oci.ini && \
rm -rf /tmp/php-src
4 changes: 2 additions & 2 deletions update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ render() {
sed -e "$sedStr" $1
}

versions=(7.1 7.2 7.3 7.4 8.0 8.1)
versions=(7.1 7.2 7.3 7.4 8.0 8.1 8.2)
for version in ${versions[*]}; do
if [ ! -d ${version} ]; then
mkdir ${version}
fi
render Dockerfile.template > ${version}/Dockerfile

## https://php.watch/versions/8.0/xmlrpc
if [[ "${version}" = "8.0" || "${version}" = "8.1" ]]; then
if [[ "${version}" = "8.0" || "${version}" = "8.1" || "${version}" = "8.2" ]]; then
sed -i "s/php\$PHP_VERSION-json/php-json/g" ${version}/Dockerfile
sed -i "s/php\$PHP_VERSION-xmlrpc//g" ${version}/Dockerfile
fi
Expand Down

0 comments on commit cf642a1

Please sign in to comment.