Repository navigation
feat(php): add the PHP 8.6 image #385
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
d66c5c9
feat(php): add the PHP 8.6 image
mrrobot47 83234c0
ci: build the PHP 8.6 image and track its base image
mrrobot47 adb53bb
build(php): base the 8.6 image on the PHP 8.6.0 release
mrrobot47 f4d0b6c
Merge branch 'develop' into feat/php-8.6
mrrobot47 b24aa74
ci(php): list the modules the PHP 8.6 image must have
mrrobot47 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,159 @@ | ||
| FROM php:8.6.0-fpm | ||
|
|
||
| LABEL maintainer="Riddhesh Sanghvi <[email protected]>" | ||
| LABEL org.label-schema.schema-version="1.0.0" | ||
| LABEL org.label-schema.vendor="EasyEngine" | ||
| LABEL org.label-schema.name="php" | ||
|
|
||
| RUN set -ex; \ | ||
| apt-get update; \ | ||
| apt-get install -y --no-install-recommends \ | ||
| imagemagick \ | ||
| less \ | ||
| mariadb-client msmtp \ | ||
| libfreetype6-dev \ | ||
| libjpeg-dev \ | ||
| libjpeg62-turbo-dev \ | ||
| libkrb5-dev \ | ||
| libmagickwand-dev \ | ||
| libgraphicsmagick1-dev \ | ||
| libmcrypt-dev \ | ||
| libicu-dev \ | ||
| libmemcached-dev \ | ||
| libonig-dev \ | ||
| libxml2-dev \ | ||
| libpng-dev \ | ||
| libzip-dev \ | ||
| libssl-dev \ | ||
| libgmp-dev \ | ||
| tmux \ | ||
| unzip \ | ||
| vim \ | ||
| zip | ||
|
|
||
| # imap is left out until it builds on 8.6, so its libc-client-dev from sury isn't needed. | ||
| #RUN curl -fsSL https://packages.sury.org/php/README.txt | bash && \ | ||
| # apt-get update && \ | ||
| # apt-get install -y libc-client-dev | ||
|
|
||
| # The 8.6 base image has no pecl (docker-library/php#1654), so extensions are built from source tarballs. | ||
| # The latest PECL releases of memcached, redis and apcu don't build on 8.6 yet; their upstream fixes are pinned instead. | ||
| RUN set -eux; \ | ||
| docker-php-source extract; \ | ||
| fetch_ext() { mkdir -p "/usr/src/php/ext/$1"; curl -fsSL "$2" | tar -xz -C "/usr/src/php/ext/$1" --strip-components=1; }; \ | ||
| fetch_ext memcached https://github.com/php-memcached-dev/php-memcached/archive/0b52d3657140750fa0eddd20cdbfc6edc8fbdadd.tar.gz; \ | ||
| fetch_ext redis https://github.com/phpredis/phpredis/archive/5b60b125aba347159b0c9c319296fbb3c5ed9214.tar.gz; \ | ||
| fetch_ext apcu https://github.com/krakjoe/apcu/archive/fb2c942552a3f5dab7f4dea4afb5cf0831222c57.tar.gz; \ | ||
| fetch_ext timezonedb https://pecl.php.net/get/timezonedb; \ | ||
| docker-php-ext-install memcached; \ | ||
| docker-php-ext-install redis; \ | ||
| docker-php-ext-install apcu; \ | ||
| docker-php-ext-install timezonedb; \ | ||
| # mcrypt and imap don't build on 8.6 yet, even from their upstream heads. | ||
| # fetch_ext mcrypt https://pecl.php.net/get/mcrypt; \ | ||
| # docker-php-ext-install mcrypt; \ | ||
| # fetch_ext imap https://pecl.php.net/get/imap; \ | ||
| # docker-php-ext-configure imap --with-kerberos --with-imap-ssl; \ | ||
| # docker-php-ext-install imap; \ | ||
| docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp; \ | ||
| docker-php-ext-configure zip; \ | ||
| docker-php-ext-install gd; \ | ||
| docker-php-ext-install mysqli; \ | ||
| docker-php-ext-install pdo_mysql; \ | ||
| docker-php-ext-install soap; \ | ||
| docker-php-ext-install intl; \ | ||
| docker-php-ext-install zip; \ | ||
| docker-php-ext-install exif; \ | ||
| docker-php-ext-install calendar; \ | ||
| docker-php-ext-install gmp; \ | ||
| docker-php-ext-install pcntl; \ | ||
| docker-php-ext-install shmop; \ | ||
| docker-php-ext-install sockets; \ | ||
| docker-php-ext-install sysvsem; \ | ||
| docker-php-ext-install sysvshm; \ | ||
| docker-php-ext-install bcmath; \ | ||
| # No longer built into the base image as of 8.6. | ||
| docker-php-ext-install mbstring; \ | ||
| docker-php-source delete; \ | ||
| apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ | ||
| rm -rf /var/lib/apt/lists/*; | ||
|
|
||
| # Temp workaround for imagick | ||
| RUN apt update && apt install -y git --no-install-recommends && \ | ||
| git clone https://github.com/Imagick/imagick.git --depth 1 /tmp/imagick && \ | ||
| cd /tmp/imagick && \ | ||
| git fetch origin master && \ | ||
| git switch master && \ | ||
| cd /tmp/imagick && \ | ||
| phpize && \ | ||
| ./configure && \ | ||
| make && \ | ||
| make install && \ | ||
| docker-php-ext-enable imagick && \ | ||
| apt remove -y git && \ | ||
| apt autoremove -y && \ | ||
| apt clean && \ | ||
| rm -rf /var/lib/apt/lists/* && \ | ||
| rm -rf /tmp/imagick | ||
|
|
||
| # set recommended PHP.ini settings | ||
| # see https://secure.php.net/manual/en/opcache.installation.php | ||
| RUN { \ | ||
| echo 'opcache.memory_consumption=128'; \ | ||
| echo 'opcache.interned_strings_buffer=8'; \ | ||
| echo 'opcache.max_accelerated_files=4000'; \ | ||
| echo 'opcache.revalidate_freq=2'; \ | ||
| echo 'opcache.fast_shutdown=1'; \ | ||
| echo 'opcache.enable_cli=1'; \ | ||
| } > /usr/local/etc/php/conf.d/opcache-recommended.ini | ||
|
|
||
| # Donwload and install composer | ||
| RUN curl -sSL "https://getcomposer.org/installer" | php \ | ||
| && mv composer.phar /usr/local/bin/composer | ||
|
|
||
| # Install wp-cli | ||
| RUN curl -O "https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar" \ | ||
| && chmod +x wp-cli.phar \ | ||
| && mv wp-cli.phar /usr/local/bin/wp | ||
|
|
||
| # Setup a config file | ||
| RUN mkdir -p /etc/wp-cli | ||
| RUN { \ | ||
| echo 'path: /var/www/htdocs'; \ | ||
| } > /etc/wp-cli/config.yml | ||
|
|
||
| RUN mkdir /usr/local/etc/misc && \ | ||
| touch /usr/local/etc/misc/msmtprc && \ | ||
| ln -s /usr/local/etc/misc/msmtprc /etc/msmtprc && \ | ||
| chown www-data:www-data /usr/local/etc/misc/msmtprc && \ | ||
| chown www-data:www-data /etc/msmtprc | ||
|
|
||
| #RUN latest_build=$(curl -s https://download.newrelic.com/php_agent/release/ | grep 'linux\.tar\.gz"' | head -n 1 | sed 's/.*"\(.*\)".*/\1/') && \ | ||
| #curl -L "https://download.newrelic.com$latest_build" | tar -C /tmp -zx && \ | ||
| #export NR_INSTALL_USE_CP_NOT_LN=1 && \ | ||
| #export NR_INSTALL_SILENT=1 && \ | ||
| #/tmp/newrelic-php5-*/newrelic-install install && \ | ||
| #rm -rf /tmp/newrelic-php5-* /tmp/nrinstall* | ||
| # | ||
| #ENV NR_PORT=/run/newrelic/newrelic.sock | ||
|
|
||
| # Setup logs | ||
| RUN mkdir -p /var/log/php; \ | ||
| chown -R www-data: /var/log/php; \ | ||
| rm /usr/local/etc/php-fpm.d/*; | ||
| COPY php.ini /usr/local/etc/php/php.ini | ||
| COPY easyengine.conf /usr/local/etc/php-fpm.d/easyengine.conf | ||
|
|
||
| COPY expose_off.ini /usr/local/etc/php/conf.d/expose_off.ini | ||
| COPY bashrc /root/.bashrc | ||
| COPY bashrc /var/www/.bashrc | ||
| COPY docker-entrypoint.sh /usr/local/bin/ | ||
| #COPY newrelic.ini /usr/local/etc/php/conf.d/newrelic.ini | ||
| #COPY newrelic.ini /data/newrelic.ini | ||
|
|
||
| WORKDIR /var/www/htdocs | ||
| RUN usermod -s /bin/bash www-data | ||
| USER www-data | ||
|
|
||
| ENTRYPOINT ["docker-entrypoint.sh"] | ||
| CMD ["php-fpm"] | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| PS1="\`if [ \$? = 0 ]; then echo \[\e[37m\]^_^[\u@$VIRTUAL_HOST:\w]\\$ \[\e[0m\]; else echo \[\e[31m\]O_O[\u@$VIRTUAL_HOST:\w]\\$ \[\e[0m\]; fi\`" | ||
| export HISTTIMEFORMAT="%d/%m/%y %T " |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| #!/bin/bash | ||
| set -euo pipefail -o nounset | ||
|
|
||
| #if [[ -z "${NEWRELIC_LICENSE_KEY:-}" ]] || [[ -z "${NEWRELIC_APPNAME:-}" ]]; then | ||
| # : | ||
| #else | ||
| # sed -i -e "s/\"REPLACE_WITH_REAL_KEY\"/\"$NEWRELIC_LICENSE_KEY\"/" \ | ||
| # -e "s/newrelic.appname = \"PHP Application\"/newrelic.appname = \"$NEWRELIC_APPNAME\"/" \ | ||
| # /usr/local/etc/php/conf.d/newrelic.ini | ||
| #fi | ||
|
|
||
| exec "$@" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| [global] | ||
| error_log = /var/log/php/error.log | ||
| daemonize = no | ||
|
|
||
| [www] | ||
| ping.path = /ee-admin/ping | ||
| pm.status_path = /ee-admin/status | ||
| request_terminate_timeout = 300 | ||
| user = www-data | ||
| group = www-data | ||
| pm = ondemand | ||
| pm.max_children = 20 | ||
| listen = 9000 | ||
| ; if we send this to /proc/self/fd/1, it never appears | ||
| access.log = /var/log/php/access.log | ||
|
|
||
| clear_env = no | ||
|
|
||
| ; Ensure worker stdout and stderr are sent to the main error log. | ||
| catch_workers_output = yes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| apcu | ||
| bcmath | ||
| calendar | ||
| Core | ||
| ctype | ||
| curl | ||
| date | ||
| dom | ||
| exif | ||
| fileinfo | ||
| filter | ||
| gd | ||
| gmp | ||
| hash | ||
| iconv | ||
| imagick | ||
| intl | ||
| json | ||
| lexbor | ||
| libxml | ||
| mbstring | ||
| memcached | ||
| mysqli | ||
| mysqlnd | ||
| openssl | ||
| pcntl | ||
| pcre | ||
| PDO | ||
| pdo_mysql | ||
| pdo_sqlite | ||
| Phar | ||
| posix | ||
| random | ||
| readline | ||
| redis | ||
| Reflection | ||
| session | ||
| shmop | ||
| SimpleXML | ||
| soap | ||
| sockets | ||
| sodium | ||
| SPL | ||
| sqlite3 | ||
| standard | ||
| sysvsem | ||
| sysvshm | ||
| timezonedb | ||
| tokenizer | ||
| uri | ||
| xml | ||
| xmlreader | ||
| xmlwriter | ||
| Zend OPcache | ||
| zip | ||
| zlib |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| expose_php = Off |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| ; This file contains the various settings for the New Relic PHP agent. There | ||
| ; are many options, all of which are described in detail at the following URL: | ||
| ; https://docs.newrelic.com/docs/agents/php-agent/configuration/php-agent-configuration | ||
| ; | ||
|
|
||
| extension = "newrelic.so" | ||
|
|
||
| [newrelic] | ||
| newrelic.license = "REPLACE_WITH_REAL_KEY" | ||
| newrelic.appname = "PHP Application" | ||
| newrelic.logfile = "/var/log/newrelic/php_agent.log" | ||
| newrelic.daemon.logfile = "/var/log/newrelic/newrelic-daemon.log" | ||
| newrelic.daemon.port = "/run/newrelic/newrelic.sock" | ||
| newrelic.transaction_tracer.record_sql = "raw" | ||
| newrelic.transaction_tracer.threshold = "1s" | ||
| newrelic.browser_monitoring.auto_instrument = 0 | ||
| newrelic.application_logging.forwarding.log_level = error | ||
| newrelic.daemon.dont_launch = 3 |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.