dibbleops/base-php

By dibbleops

Updated 6 days ago

Base PHP image

Image
Languages & frameworks
Web servers
0

6.6K

dibbleops/base-php repository overview

PHP-FPM base image

A base image to build php-fpm docker images fast.

The image installs useful PHP extensions, composer and activates jit.

Usage

1] Use the FROM tag at the top of the Dockerfile, such as:

FROM dibbleops/base-php:8.1-fpm
FROM dibbleops/base-php:8.1-fpm-alpine

2] Composer is found at /usr/local/bin/composer. Usage example:

RUN /usr/local/bin/composer install --no-dev

3] The list of available PHP extensions:

apcugdopcachesession
bcmathgmp*opensslSimpleXML
Corehashpcresodium
ctypeiconvpcntlSPL
curlimagick*PDOsqlite3
dateintlpdo_sqlitestandard
domjsonPhartokenizer
exiflibxmlposixxml
fileinfombstringreadlinexmlreader
filtermysqliredisxmlwriter
ftpmysqlndReflectionzlib

* Not in alpine image

In addition, the xdebug extension is installed but not enabled.

php.ini file

A new php.ini file may be copied at PHP_INI_DIR in order to override the exiting file.

COPY ./php.ini $PHP_INI_DIR

pecl and docker-php-ext-* in alpine image

Before using pecl or docker-php-ext-* commands, add the following statement to the Dockerfile:

RUN apk add --no-cache --virtual .build-deps $PHPIZE_DEPS

Then use pecl and docker-php-ext-* commands as usual, for instance:

# Install the PHP mysqli extention
RUN docker-php-ext-install mysqli && \
    docker-php-ext-enable mysqli

After all such commands, cleanup with:

RUN apk del --no-network .build-deps
RUN rm -rf /tmp/* /var/tmp/*

Tag summary

Content type

Image

Digest

sha256:1ef150a03

Size

58.4 MB

Last updated

6 days ago

docker pull dibbleops/base-php:8.3-fpm-alpine