Commit a54c3312 authored by Anja Leichsenring's avatar Anja Leichsenring
Browse files

[FEATURE] PHP 7.4 container

parent 88994089
......@@ -62,6 +62,13 @@ PATCHLEVEL_PHP73=9
FULLVERSION_PHP73=$(MAJOR_PHP73).$(MINOR_PHP73).$(PATCHLEVEL_PHP73)
SHORTVERSION_PHP73=$(MAJOR_PHP73).$(MINOR_PHP73)
NAME_PHP74 = typo3gmbh/php74
MAJOR_PHP74=3
MINOR_PHP74=0
PATCHLEVEL_PHP74=1
FULLVERSION_PHP74=$(MAJOR_PHP74).$(MINOR_PHP74).$(PATCHLEVEL_PHP74)
SHORTVERSION_PHP74=$(MAJOR_PHP74).$(MINOR_PHP74)
NAME_JS = typo3gmbh/js
MAJOR_JS=2
MINOR_JS=0
......@@ -90,6 +97,7 @@ SHORTVERSION_BAMBOO=$(MAJOR_BAMBOO).$(MINOR_BAMBOO)
build_php71 \
build_php72 \
build_php73 \
build_php74 \
build_js \
build_bamboo \
release \
......@@ -102,6 +110,7 @@ SHORTVERSION_BAMBOO=$(MAJOR_BAMBOO).$(MINOR_BAMBOO)
release_php71 \
release_php72 \
release_php73 \
release_php74 \
release_js \
release_bamboo \
clean \
......@@ -114,6 +123,7 @@ SHORTVERSION_BAMBOO=$(MAJOR_BAMBOO).$(MINOR_BAMBOO)
clean_php71 \
clean_php72 \
clean_php73 \
clean_php74 \
clean_js \
clean_bamboo \
clean_images \
......@@ -126,6 +136,7 @@ SHORTVERSION_BAMBOO=$(MAJOR_BAMBOO).$(MINOR_BAMBOO)
clean_images_php71 \
clean_images_php72 \
clean_images_php73 \
clean_images_php74 \
clean_images_js \
clean_images_bamboo
......@@ -148,7 +159,8 @@ build_php: \
build_php70 \
build_php71 \
build_php72 \
build_php73
build_php73 \
build_php74
release: \
release_baseimage \
......@@ -164,7 +176,8 @@ release_php: \
release_php70 \
release_php71 \
release_php72 \
release_php73
release_php73 \
release_php74
clean: \
clean_baseimage \
......@@ -176,6 +189,7 @@ clean: \
clean_php71 \
clean_php72 \
clean_php73 \
clean_php74 \
clean_bamboo \
clean_js
......@@ -190,6 +204,7 @@ clean_images: \
clean_images_php71 \
clean_images_php72 \
clean_images_php73 \
clean_images_php74 \
clean_images_bamboo \
clean_js
......@@ -411,6 +426,29 @@ clean_images_php73:
docker rmi $(NAME_PHP73):$(FULLVERSION_PHP73) || true
build_php74: build_baseimage
rm -rf build_php74
cp -pR php74 build_php74
docker build -t $(NAME_PHP74):$(FULLVERSION_PHP74) build_php74
docker tag $(NAME_PHP74):$(FULLVERSION_PHP74) $(NAME_PHP74):$(SHORTVERSION_PHP74)
release_php74:
@if ! docker images $(NAME_PHP74) | awk '{ print $$2 }' | grep -q -F $(FULLVERSION_PHP74); then \
echo "$(NAME_PHP74) version $(FULLVERSION_PHP74) is not yet built. Please run 'make build'"; false; \
fi
docker tag $(NAME_PHP74):$(FULLVERSION_PHP74) $(NAME_PHP74):latest
docker push $(NAME_PHP74):latest
docker push $(NAME_PHP74):$(FULLVERSION_PHP74)
docker push $(NAME_PHP74):$(SHORTVERSION_PHP74)
clean_php74:
rm -rf build_php74
clean_images_php74:
docker rmi $(NAME_PHP74):latest || true
docker rmi $(NAME_PHP74):$(SHORTVERSION_PHP74) || true
docker rmi $(NAME_PHP74):$(FULLVERSION_PHP74) || true
build_bamboo: build_baseimage
rm -rf build_bamboo
......
FROM typo3gmbh/baseimage:latest
MAINTAINER TYPO3 GmbH <info@typo3.com>
ADD . /pd_build
RUN /pd_build/enable_repos.sh && \
/pd_build/nodejs.sh && \
/pd_build/php.sh && \
/pd_build/finalize.sh
export LC_ALL=C
export DEBIAN_FRONTEND=noninteractive
function minimal_apt_get_install()
{
if [[ ! -e /var/lib/apt/lists/lock ]]; then
apt-get update
fi
apt-get install -y --no-install-recommends "$@"
}
#!/bin/bash
set -e
source /pd_build/buildconfig
set -x
apt-get update
# ondrej with a php 7.3
echo deb http://ppa.launchpad.net/ondrej/php/ubuntu bionic main > /etc/apt/sources.list.d/php.list
# ondrej key - the recv-keys part takes a bit of time, so it's faster to receive multiple keys at once.
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys \
E5267A6C \
#
# for msodbcsql17 mssql-tools sqlserv
curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
curl https://packages.microsoft.com/config/ubuntu/18.04/prod.list > /etc/apt/sources.list.d/mssql-release.list
apt-get update
apt-get -y dist-upgrade
#!/bin/bash
set -e
source /pd_build/buildconfig
set -x
# remove a ton of packages needed for compilation of php modules
apt-get remove -y --purge \
autoconf \
autotools-dev \
file \
libquadmath0 \
libtool \
php7.4-dev \
#
apt-get clean
apt-get -y autoremove
rm -rf \
/var/lib/apt/lists/* \
/root/.npm/ \
/tmp/* \
/var/tmp/* \
/usr/local/src/* \
#
rm -rf /pd_build
#!/bin/bash
set -e
source /pd_build/buildconfig
set -x
# Install Node.js and some packages to successfully compile stuff
minimal_apt_get_install npm nodejs make g++
# And have yarn
npm install -g yarn
# And remove npm again
apt-get remove -y --purge npm
#!/bin/bash
set -e
source /pd_build/buildconfig
set -x
minimal_apt_get_install \
make \
php7.4 \
php7.4-bcmath \
php7.4-bz2 \
php7.4-cli \
php7.4-common \
php7.4-curl \
php7.4-dev \
php7.4-gd \
php7.4-gmp \
php7.4-imap \
php7.4-intl \
php7.4-json \
php7.4-ldap \
php7.4-mbstring \
php7.4-mysql \
php7.4-opcache \
php7.4-pgsql \
php7.4-pspell \
php7.4-readline \
php7.4-soap \
php7.4-sqlite3 \
php7.4-xml \
php7.4-xmlrpc \
php7.4-xsl \
php7.4-zip \
php-apcu \
php-pear \
php-redis \
php-memcached \
php-xdebug \
re2c \
graphicsmagick \
imagemagick \
zip \
unzip \
sqlite3 \
#
# Disable opcache on php 7.4 since that triggers segfaults 'zend_mm_heap corrupted' with vfsStream 1.6.4 (currently)
# Note: Still true?
echo "opcache.enable_cli=0" >> /etc/php/7.4/cli/conf.d/10-opcache.ini
# Enable phar writing
sed -i s/';phar.readonly = On'/'phar.readonly = Off'/ /etc/php/7.4/cli/php.ini
# Restrict cli based php.ini settings for php -S web server to have sane values in acceptance tests
sed -i s/'memory_limit = -1'/'memory_limit = 2G'/ /etc/php/7.4/cli/php.ini
sed -i s/'max_execution_time = 30'/'max_execution_time = 240'/ /etc/php/7.4/cli/php.ini
sed -i s/'; max_input_vars = 1000'/'max_input_vars = 1500'/ /etc/php/7.4/cli/php.ini
echo "xdebug.max_nesting_level = 400" >> /etc/php/7.4/mods-available/xdebug.ini
# Enable apc on cli for unit tests
echo "apc.enable_cli=1" >> /etc/php/7.4/mods-available/apcu.ini
echo "apc.slam_defense=0" >> /etc/php/7.4/mods-available/apcu.ini
# mssql driver
ACCEPT_EULA=Y minimal_apt_get_install \
msodbcsql17 \
mssql-tools \
unixodbc-dev \
#
pecl channel-update pecl.php.net
minimal_apt_get_install build-essential
pecl install sqlsrv-5.7.0preview
pecl install pdo_sqlsrv-5.7.0preview
echo extension=sqlsrv.so >> /etc/php/7.4/mods-available/sqlsrv.ini
echo extension=pdo_sqlsrv.so >> /etc/php/7.4/mods-available/pdo_sqlsrv.ini
phpenmod sqlsrv
phpenmod pdo_sqlsrv
# Prepare an additional php.ini file that does *NOT* include xdebug
# can be used with: php -n -c /etc/php/cli-no-xdebug/php.ini
mkdir /etc/php/cli-no-xdebug/
php -i | \
grep "\.ini" | \
grep -o -e '\(/[A-Za-z0-9._-]\+\)\+\.ini' | \
grep -v xdebug | \
xargs awk 'FNR==1{print ""}1' | \
grep -v '^;' | \
grep -v '^$' > /etc/php/cli-no-xdebug/php.ini
# Install composer
curl -sSL https://getcomposer.org/download/1.9.1/composer.phar -o /usr/bin/composer
chmod +x /usr/bin/composer
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment