More info about PHP images

docker
php

#1

I was trying to use circleci/php:7.0-cli-node image and I got an error

Can you provide more info about Docker images for PHP? I don’t know if any of available images contains missing extensions.


#2

We’re just extending the official ones, so fundamentally they are the same. You can do this:

pecl install xdebug && docker-php-ext-enable xdebug

Here is a snippet from a PHP project I onboarded

- run: sudo apt-get update
- run: sudo apt-get install libzip-dev libwebp-dev libjpeg-dev libpng-dev libz-dev libxpm-dev libmcrypt-
dev
# Install additional PHP modules
- run: sudo pecl channel-update pecl.php.net
- run: sudo pecl install zip && sudo docker-php-ext-enable zip
- run: sudo pecl install xdebug && sudo docker-php-ext-enable xdebug
- run: sudo docker-php-ext-install gd
- run: sudo docker-php-ext-install bcmath && sudo docker-php-ext-enable bcmath
- run: sudo docker-php-ext-install mcrypt && sudo docker-php-ext-enable mcrypt
- run: sudo docker-php-ext-install pdo_mysql && sudo docker-php-ext-enable pdo_mysql
- run: sudo apt-get install mysql-client
# Install NGINX
- run: sudo apt-get install nginx
- run: sudo /etc/init.d/nginx start
# Start PHP-FPM pool
- run: sudo php-fpm -D -y tests/_data/circleci.conf
- run: php composer.phar self-update
- run: sudo npm install -g bower

I think that predated our images so some of it is probably superfluous.

The best way to see what was run on the image is to use docker history;

docker history --no-trunc circleci/php:7.0-cli-node

#3

Thanks for response. It looks like pecl.php.net is down so I guess it will be easier for me to change strategy and prepare custom images.


#4

Removing the update line might solve that


#5

We’ve open sourced the repo now;


#6