Git Product home page Git Product logo

docker-php's People

Contributors

aegypius avatar lucasmirloup avatar pierreboissinot avatar thislg avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

docker-php's Issues

default user and known_hosts

The default user can't add an entry for known_host on the host machine.
Fix suggested by @aegypius

FROM lephare/php:7.2 

RUN chown -R www-data. /var/www
USER www-data 
RUN mkdir /var/www/.ssh 

Tag Docker latest ?

Peut-on rajouter le tag latest à chaque build de la dernière version de lephare/php ? (en + du tag de la version évidemment)

fix: backport multi-architecture handling to previous PHP versions

Some lephare/php images don't work on other architectures than x86_64.

Blackfire's architecture is hardcoded in lephare/php <= 8.0 :

RUN version=$(php -r "echo PHP_MAJOR_VERSION.PHP_MINOR_VERSION;") \
&& curl -A "Docker" -o /tmp/blackfire-probe.tar.gz -D - -L -s https://blackfire.io/api/v1/releases/probe/php/linux/amd64/$version \
&& mkdir -p /tmp/blackfire \
&& tar zxpf /tmp/blackfire-probe.tar.gz -C /tmp/blackfire \
&& mv /tmp/blackfire/blackfire-*.so $(php -r "echo ini_get('extension_dir');")/blackfire.so \
&& printf "extension=blackfire.so\nblackfire.agent_socket=tcp://blackfire:8707\n" > $PHP_INI_DIR/conf.d/blackfire.ini \
&& rm -rf /tmp/blackfire /tmp/blackfire-probe.tar.gz

Already patched in 8.1 version :

RUN version=$(php -r "echo PHP_MAJOR_VERSION.PHP_MINOR_VERSION;") \
&& architecture=$(uname -m) \
&& curl -A "Docker" -o /tmp/blackfire-probe.tar.gz -D - -L -s https://blackfire.io/api/v1/releases/probe/php/linux/$architecture/$version \
&& mkdir -p /tmp/blackfire \
&& tar zxpf /tmp/blackfire-probe.tar.gz -C /tmp/blackfire \
&& mv /tmp/blackfire/blackfire-*.so $(php -r "echo ini_get ('extension_dir');")/blackfire.so \
&& printf "extension=blackfire.so\nblackfire.agent_socket=tcp://blackfire:8307\n" > $PHP_INI_DIR/conf.d/blackfire.ini \
&& rm -rf /tmp/blackfire /tmp/blackfire-probe.tar.gz

There may be other hardcoded dependencies.

Even though PHP versions < 7.4 aren't supported anymore, it could be useful to patch them.

Proposal - Merge PHP 8 versions into a single Dockerfile

PHP 8 is quite consistent with its extensions and configuration, it may be more efficient for maintainers to use a single Dockerfile with multiple targets. This mean a single configuration file for all PHP 8 targets and parallel build to decrease build time.

This will solve #16 and reduce CI time in the future.

# ================================
# Configure base images
# ================================
FROM php:8.0-fpm as base_php_80
FROM php:8.1-fpm as base_php_81
FROM php:8.2-fpm as base_php_82
FROM php:8.3-fpm as base_php_83
FROM composer:2 as composer
FROM mlocati/php-extension-installer as extension-installer

# ================================
# Configure PHP
# ================================
FROM scratch as config 
WORKDIR /etc/php/conf.d/
COPY --link symfony.ini .
WORKDIR /etc/php/pool.d/
COPY --link symfony.pool.conf .

# ================================
# Build Final Images
# ================================
FROM base_php_80 as php_80
COPY --from=config / /
COPY --from=composer /usr/bin/composer /usr/local/bin/composer
COPY --from=extension-installer /usr/bin/install-php-extensions /usr/local/bin/
RUN install-php-extension intl gd opcache mbstring zip pdo_pgsql soap pgsql exif apcu  memcached imagick xdebug

FROM base_php_81 as php_81
COPY --from=config / /
COPY --from=composer /usr/bin/composer /usr/local/bin/composer
COPY --from=extension-installer /usr/bin/install-php-extensions /usr/local/bin/
RUN install-php-extension intl gd opcache mbstring zip pdo_pgsql soap pgsql exif apcu  memcached imagick xdebug

 # ...

Disable xdebug by default

Xdebug is set to "develop" by default. It makes local development quite slow compared to when it is completely off (10 seconds Symfony cache warmup instead of 100 ms in PHP 8.2 in my case).

It used to be set to "off" but this PR changed it: #7

I suggest we put back this env variable, and override will be allowed by passing the same env variable.

PHP crashes repeatedly since last build

Affected versions

  • 8.2
  • 8.1
  • Probably 8.0 too

Docker logs coming from the container :

php-1  | [05-Mar-2024 09:20:03] WARNING: [pool www] child 26 exited on signal 11 (SIGSEGV - core dumped) after 21.837472 seconds from start
php-1  | [05-Mar-2024 09:20:03] NOTICE: [pool www] child 45 started
php-1  | [05-Mar-2024 09:20:07] WARNING: [pool www] child 44 exited on signal 11 (SIGSEGV - core dumped) after 6.753403 seconds from start
php-1  | [05-Mar-2024 09:20:07] NOTICE: [pool www] child 46 started

Disabling Xdebug via its env variable (XDEBUG_MODE=off) stops all crashes.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.