Skip to content
Open
10 changes: 5 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# syntax=docker/dockerfile:1.4
ARG VERSION=7.3
ARG BASEOS=bullseye
ARG REDIS_VERSION=6.2
ARG VERSION
ARG BASEOS
# The redis version is only used in the console image but needs a default value to avoid failing base image
ARG REDIS_VERSION=invalid
FROM php:${VERSION}-fpm-${BASEOS} as base

# Base Packages
# ---
ARG BASEOS=bullseye
ARG BASEOS
ENV IMAGE_TYPE=base
RUN <<EOF
set -o errexit
Expand Down Expand Up @@ -47,7 +48,6 @@ RUN cd /root/installer; ./enable.sh \
bcmath \
gd \
intl \
"$(dpkg --compare-versions "$PHP_VERSION" ge 8.3 || echo mcrypt )" \
opcache \
pdo_mysql \
pdo_pgsql \
Expand Down
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pipeline {
axes {
axis {
name 'BUILD'
values 'php81', 'php82', 'php83', 'php84'
values 'php83', 'php84'
}
axis {
name 'PLATFORM'
Expand Down
112 changes: 86 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,37 +1,97 @@
# PHP Images

## Contents

- [Base](#base)
- [Console](#console)
- [Supported Versions](#supported-versions)
- [Build and Test](#build-and-test)

## Base

A starting point with some common extensions for running various frameworks and applications.

<!-- markdownlint-disable MD024 -->

### Packages
* php-bcmath
* php-gd
* php-intl
* php-mcrypt
* php-opcache
* php-pdo (mysql)
* php-soap
* php-xdebug
* php-xsl
* php-zip

- php-bcmath
- php-gd
- php-intl
- php-mcrypt
- php-opcache
- php-pdo (mysql)
- php-soap
- php-xdebug
- php-xsl
- php-zip

## Console

Used in development for building and interacting with the application with a familiar set of tools, can also be used as part of a multi-stage build docker image.

### Packages

* build-tools (autoconf, automake, g++, gcc, make, nasm)
* composer (1.10.27 or 2.7.2)
* curl
* gettext-base
* git
* iproute
* mysql (client)
* nano
* nvm
* node (lts/dubnium aka v10, or none for PHP 8.3+)
* npm
* patch
* rsync
* wget
* yarn (if node is installed)
* zip
- build-tools (autoconf, automake, g++, gcc, make, nasm)
- composer (1.10.27 or 2.7.2)
- curl
- gettext-base
- git
- iproute
- mysql (client)
- nano
- nvm
- node (lts/dubnium aka v10, or none for PHP 8.3+)
- npm
- patch
- redis-cli
- rsync
- wget
- yarn (if node is installed)
- zip

## Supported Versions

| PHP version | Bookworm | Trixie |
| --- | --- | --- |
| `8.3` | Base + Console | Base + Console |
| `8.4` | Base + Console | Base + Console |

## Build and Test

Build and test all Trixie images:

```bash
BUILD=trixie ./build.sh
BUILD=trixie ./test.sh
docker image rm \
my127/php:8.3-fpm-trixie \
my127/php:8.3-fpm-trixie-console \
my127/php:8.4-fpm-trixie \
my127/php:8.4-fpm-trixie-console
```

Build and test all PHP 8.4 images:

```bash
BUILD=php84 ./build.sh
BUILD=php84 ./test.sh
docker image rm \
my127/php:8.4-fpm-bookworm \
my127/php:8.4-fpm-bookworm-console \
my127/php:8.4-fpm-trixie \
my127/php:8.4-fpm-trixie-console
```

Build and test a single image:

```bash
BUILD=php84-fpm-trixie-console ./build.sh
BUILD=php84-fpm-trixie-console ./test.sh
```

Remove locally built images when finished:

```bash
docker image rm my127/php:8.4-fpm-trixie-console
```
108 changes: 33 additions & 75 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,50 +1,22 @@
services:
# Base Images
php81-fpm-bullseye-base:
image: my127/php:8.1-fpm-bullseye${TAG_SUFFIX:-}
build:
context: ./
target: base
args:
VERSION: "8.1"
BASEOS: bullseye

php81-fpm-bookworm-base:
image: my127/php:8.1-fpm-bookworm${TAG_SUFFIX:-}
build:
context: ./
target: base
args:
VERSION: "8.1"
BASEOS: bookworm

php82-fpm-bullseye-base:
image: my127/php:8.2-fpm-bullseye${TAG_SUFFIX:-}
build:
context: ./
target: base
args:
VERSION: "8.2"
BASEOS: bullseye

php82-fpm-bookworm-base:
image: my127/php:8.2-fpm-bookworm${TAG_SUFFIX:-}
php83-fpm-bookworm-base:
image: my127/php:8.3-fpm-bookworm${TAG_SUFFIX:-}
build:
context: ./
target: base
args:
VERSION: "8.2"
VERSION: "8.3"
BASEOS: bookworm

php83-fpm-bookworm-base:
image: my127/php:8.3-fpm-bookworm${TAG_SUFFIX:-}
php83-fpm-trixie-base:
image: my127/php:8.3-fpm-trixie${TAG_SUFFIX:-}
build:
context: ./
target: base
args:
VERSION: "8.3"
REDIS_VERSION: "7.2"
BASEOS: bookworm
BASEOS: trixie

php84-fpm-bookworm-base:
image: my127/php:8.4-fpm-bookworm${TAG_SUFFIX:-}
Expand All @@ -53,72 +25,58 @@ services:
target: base
args:
VERSION: "8.4"
REDIS_VERSION: "7.4"
BASEOS: bookworm

# Console Images
php81-fpm-bullseye-console:
image: my127/php:8.1-fpm-bullseye-console${TAG_SUFFIX:-}
php84-fpm-trixie-base:
image: my127/php:8.4-fpm-trixie${TAG_SUFFIX:-}
build:
context: ./
target: console
target: base
args:
VERSION: "8.1"
COMPOSER_VERSION: "2.8.12"
NODE_VERSION: "10"
BASEOS: bullseye
VERSION: "8.4"
BASEOS: trixie

php81-fpm-bookworm-console:
image: my127/php:8.1-fpm-bookworm-console${TAG_SUFFIX:-}
# Console Images
php83-fpm-bookworm-console:
image: my127/php:8.3-fpm-bookworm-console${TAG_SUFFIX:-}
build:
context: ./
target: console
args:
VERSION: "8.1"
COMPOSER_VERSION: "2.8.12"
NODE_VERSION: "10"
VERSION: "8.3"
COMPOSER_VERSION: "2.10.1"
REDIS_VERSION: "7.2"
BASEOS: bookworm

php82-fpm-bullseye-console:
image: my127/php:8.2-fpm-bullseye-console${TAG_SUFFIX:-}
php83-fpm-trixie-console:
image: my127/php:8.3-fpm-trixie-console${TAG_SUFFIX:-}
build:
context: ./
target: console
args:
VERSION: "8.2"
COMPOSER_VERSION: "2.8.12"
NODE_VERSION: "10"
BASEOS: bullseye

php82-fpm-bookworm-console:
image: my127/php:8.2-fpm-bookworm-console${TAG_SUFFIX:-}
build:
context: ./
target: console
args:
VERSION: "8.2"
COMPOSER_VERSION: "2.8.12"
NODE_VERSION: "10"
BASEOS: bookworm
VERSION: "8.3"
COMPOSER_VERSION: "2.10.1"
REDIS_VERSION: "8.8"
BASEOS: trixie

php83-fpm-bookworm-console:
image: my127/php:8.3-fpm-bookworm-console${TAG_SUFFIX:-}
php84-fpm-bookworm-console:
image: my127/php:8.4-fpm-bookworm-console${TAG_SUFFIX:-}
build:
context: ./
target: console
args:
VERSION: "8.3"
COMPOSER_VERSION: "2.8.12"
REDIS_VERSION: "7.2"
VERSION: "8.4"
COMPOSER_VERSION: "2.10.1"
REDIS_VERSION: "7.4"
BASEOS: bookworm

php84-fpm-bookworm-console:
image: my127/php:8.4-fpm-bookworm-console${TAG_SUFFIX:-}
php84-fpm-trixie-console:
image: my127/php:8.4-fpm-trixie-console${TAG_SUFFIX:-}
build:
context: ./
target: console
args:
VERSION: "8.4"
COMPOSER_VERSION: "2.8.12"
REDIS_VERSION: "7.4"
BASEOS: bookworm
COMPOSER_VERSION: "2.10.1"
REDIS_VERSION: "8.8"
BASEOS: trixie
24 changes: 6 additions & 18 deletions installer/base/extensions/gd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,12 @@ function compile_gd()
{
_gd_deps_build

case "$VERSION" in
"7.3")
docker-php-ext-configure gd \
--with-gd \
--with-freetype-dir=/usr/include/ \
--with-png-dir=/usr/include/ \
--with-jpeg-dir=/usr/include/ \
--with-webp-dir=/usr/include/ \
--with-xpm-dir=/usr/include/
;;
*)
docker-php-ext-configure gd \
--enable-gd \
--with-freetype \
--with-jpeg \
--with-webp \
--with-xpm
esac
docker-php-ext-configure gd \
--enable-gd \
--with-freetype \
--with-jpeg \
--with-webp \
--with-xpm

docker-php-ext-install gd

Expand Down
11 changes: 1 addition & 10 deletions installer/base/extensions/protobuf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,5 @@ function install_protobuf()

function compile_protobuf()
{
case "$VERSION" in
7.*)
printf "\n" | pecl install protobuf-3.20.3
;;
8.0)
printf "\n" | pecl install protobuf-3.25.3
;;
*)
printf "\n" | pecl install protobuf
esac
printf "\n" | pecl install protobuf
}
8 changes: 2 additions & 6 deletions installer/base/extensions/tideways.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,7 @@ function _tideways_deps_runtime()

function _tideways_deps_build()
{
install \
apt-transport-https \
gnupg2

echo 'deb https://packages.tideways.com/apt-packages-main any-version main' > /etc/apt/sources.list.d/tideways.list
curl --fail --silent --show-error --location 'https://packages.tideways.com/key.gpg' | apt-key add -
curl --fail --silent --show-error --location --output /usr/share/keyrings/tideways.asc 'https://packages.tideways.com/key.gpg'
echo 'deb [signed-by=/usr/share/keyrings/tideways.asc] https://packages.tideways.com/apt-packages-main any-version main' > /etc/apt/sources.list.d/tideways.list
apt-get update -qq
}
10 changes: 1 addition & 9 deletions installer/base/extensions/xdebug.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,5 @@ function compile_xdebug()
(
set -o errexit -o pipefail

case "$VERSION" in
7.*)
XDEBUG_PACKAGE="xdebug-2.9.8"
printf "\n" | pecl install "$XDEBUG_PACKAGE"
;;
*)
XDEBUG_PACKAGE="xdebug"
printf "\n" | pecl install "$XDEBUG_PACKAGE"
esac
printf "\n" | pecl install xdebug
)
Loading