This Docker image is designed to facilitate testing PHP applications using TeamCity. It includes the required libraries and extensions, such as libmagickwand-dev, libpng-dev, libjpeg-dev, and libwebp-dev. Additionally, it installs and configures pdo_mysql, mysqli, and the Imagick extension.
FROM php:8.3-cli
RUN apt-get update; \
apt-get install -y --no-install-recommends \
libmagickwand-dev libpng-dev libjpeg-dev libwebp-dev
RUN rm /etc/ImageMagick-6/policy.xml
RUN docker-php-ext-configure pdo_mysql --with-pdo-mysql=mysqlnd
RUN docker-php-ext-configure mysqli --with-mysqli=mysqlnd
RUN docker-php-ext-install mysqli pdo pdo_mysql exif gd
RUN curl -fL -o imagick.tgz 'https://pecl.php.net/get/imagick-3.7.0.tgz'; \
echo '5a364354109029d224bcbb2e82e15b248be9b641227f45e63425c06531792d3e *imagick.tgz' | sha256sum -c -; \
tar --extract --directory /tmp --file imagick.tgz imagick-3.7.0; \
grep '^//#endif$' /tmp/imagick-3.7.0/Imagick.stub.php; \
test "$(grep -c '^//#endif$' /tmp/imagick-3.7.0/Imagick.stub.php)" = '1'; \
sed -i -e 's!^//#endif$!#endif!' /tmp/imagick-3.7.0/Imagick.stub.php; \
grep '^//#endif$' /tmp/imagick-3.7.0/Imagick.stub.php && exit 1 || :; \
docker-php-ext-install /tmp/imagick-3.7.0; \
rm -rf imagick.tgz /tmp/imagick-3.7.0;- PHP Version: 8.3 CLI
- Installed Libraries:
libmagickwand-devlibpng-devlibjpeg-devlibwebp-dev
- PHP Extensions:
pdo_mysql(configured withmysqlnd)mysqli(configured withmysqlnd)exifgdimagick(version 3.7.0)
This image can be used in your TeamCity build configurations to test PHP applications that require the above-mentioned libraries and extensions. Simply use this image in your build steps where PHP execution is needed.
version: '2'
services:
php:
image: joelgg/php-cli-mysqli:latest
volumes:
- .:/app
working_dir: /app
command: ["php", "your-script.php"]To rebuild or customize the image, you can clone the repository and use the following commands:
docker build -t joelgg/php-cli-mysqli .
docker push joelgg/php-cli-mysqliIf you'd like to contribute to improving or extending this image, feel free to open a pull request or issue on the GitHub repository. Contributions are always welcome.
So I used the wordpress method github link
docker build -t joelgg/php-cli-mysqli:php8.3 . --platform linux/amd64
docker push joelgg/php-cli-mysqli:php8.3