Skip to content

Commit

Permalink
Add PHP 8.2 and remove PHP 7.4
Browse files Browse the repository at this point in the history
  • Loading branch information
sandrokeil committed Feb 22, 2023
1 parent 0f071e6 commit 3d954ca
Show file tree
Hide file tree
Showing 12 changed files with 74 additions and 64 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ jobs:
fail-fast: false
matrix:
php-version:
- "7.4"
- "8.0"
- "8.1"
- "8.2"
php-target:
- "cli"
- "fpm"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_push_php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ jobs:
fail-fast: false
matrix:
php-version:
- "7.4"
- "8.0"
- "8.1"
- "8.2"
php-target:
- "cli"
- "fpm"
Expand Down
27 changes: 15 additions & 12 deletions php/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,21 @@ Extends the official PHP image with the following PHP extensions:

See [prooph/proophessor-do app](https://github.com/prooph/proophessor-do) for an example.

> Each image has tags for 7.4, 8.0 and 8.1
> Each image has tags for 7.4, 8.0, 8.1 and 8.2
There are also PHP ZTS versions.

## cli
Use the following image: `prooph/php:8.0-cli`.
Use the following image: `prooph/php:8.2-cli`.

## cli with Opcache
Use the following image: `prooph/php:8.0-cli-opcache`.
Use the following image: `prooph/php:8.2-cli-opcache`.

The [PHP Opcache](http://php.net/manual/en/book.opcache.php) is not useful for development, so it's not part of the default PHP-FPM image. Use
this image if you want to have Opcache enabled.

## cli with Xdebug
Use the following image: `prooph/php:8.0-cli-xdebug`.
Use the following image: `prooph/php:8.2-cli-xdebug`.

[Xdebug](http://xdebug.org/) is a PHP debugger.

Expand All @@ -50,45 +50,45 @@ path mapping in your IDE with the name *application* !
Run the following command with the path to your php file.

```bash
$ docker run --rm -it --volume $(pwd):/app -e PHP_IDE_CONFIG="serverName=application" prooph/php:8.0-cli-xdebug php [your file]
$ docker run --rm -it --volume $(pwd):/app -e PHP_IDE_CONFIG="serverName=application" prooph/php:8.2-cli-xdebug php [your file]
```

Mac users doesn't have `docker0` network. According to [networking features](https://docs.docker.com/docker-for-mac/networking/#known-limitations-use-cases-and-workarounds) they should change hostname.

```bash
$ docker run --rm -it --volume $(pwd):/app -e PHP_IDE_CONFIG="serverName=application" -e XDEBUG_HOST="docker.for.mac.localhost" prooph/php:8.0-cli-xdebug php [your file]
$ docker run --rm -it --volume $(pwd):/app -e PHP_IDE_CONFIG="serverName=application" -e XDEBUG_HOST="docker.for.mac.localhost" prooph/php:8.2-cli-xdebug php [your file]
```

## cli with SensioLabs Blackfire
Use the following image: `prooph/php:8.0-cli-blackfire`.
Use the following image: `prooph/php:8.2-cli-blackfire`.

[Blackfire](https://blackfire.io) is a PHP Profiler. No linking with Blackfire-Agent required.

Run the following command with your [Blackfire](https://blackfire.io/docs/reference-guide/configuration) credentials to profile you cli PHP apps.

```bash
$ docker run --rm -it -e BLACKFIRE_SERVER_ID=[YOUR ID] -e BLACKFIRE_SERVER_TOKEN=[YOUR TOKEN] -e BLACKFIRE_CLIENT_ID=[YOUR ID] -e BLACKFIRE_CLIENT_TOKEN=[YOUR TOKEN] --volume $(pwd):/app prooph/php:8.0-cli-blackfire run php [your PHP script]
$ docker run --rm -it -e BLACKFIRE_SERVER_ID=[YOUR ID] -e BLACKFIRE_SERVER_TOKEN=[YOUR TOKEN] -e BLACKFIRE_CLIENT_ID=[YOUR ID] -e BLACKFIRE_CLIENT_TOKEN=[YOUR TOKEN] --volume $(pwd):/app prooph/php:8.2-cli-blackfire run php [your PHP script]
```

## fpm
Use the following image: `prooph/php:8.0-fpm`.
Use the following image: `prooph/php:8.2-fpm`.

## fpm with Opcache
Use the following image: `prooph/php:8.0-fpm-opcache`.
Use the following image: `prooph/php:8.2-fpm-opcache`.

The [PHP Opcache](http://php.net/manual/en/book.opcache.php) is not useful for development, so it's not part of the default PHP-FPM image. Use
this image if you want to have Opcache enabled.

## fpm with Xdebug
Use the following image: `prooph/php:8.0-fpm-xdebug`.
Use the following image: `prooph/php:8.2-fpm-xdebug`.

[Xdebug](http://xdebug.org/) is a PHP debugger.

Configure the Xdebug port in your IDE with `10000` and set the path mappings for the project root folder on server
to `/var/www`. The server name is `localhost`. Don't forget to set the Xdebug cookie in your browser to start debugging.

## fpm with Blackfire
Use the following image: `prooph/php:8.0-fpm-blackfire`.
Use the following image: `prooph/php:8.2-fpm-blackfire`.

[SensioLabs Blackfire](https://blackfire.io/) is a PHP Profiler.

Expand All @@ -111,6 +111,9 @@ To run Composer use:
$ docker run --rm -it --volume $(pwd):/app prooph/composer:7.4 [your composer command]
```

## Composer with PHP 8.2
Use the following image: `prooph/composer:8.2`.

## Composer with PHP 8.1
Use the following image: `prooph/composer:8.1`.

Expand Down
3 changes: 2 additions & 1 deletion php/inc/php-ext.m4
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ ENV PHPIZE_DEPS \
libxslt-dev \
# for intl extension
icu-dev \
openssl-dev
openssl-dev \
linux-headers

RUN apk add --no-cache --virtual .persistent-deps \
# for intl extension
Expand Down
3 changes: 2 additions & 1 deletion php/inc/xdebug.m4
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ ENV PHPIZE_DEPS \
gcc \
make \
pkgconf \
re2c
re2c \
linux-headers

RUN set -xe \
&& apk add --no-cache --virtual .build-deps \
Expand Down
4 changes: 2 additions & 2 deletions php/m4/php-cli.m4
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
include(`macros.m4')
DONT_CHANGE()

ARG ALPINE_VERSION=3.15
ARG PHP_VERSION=8.0
ARG ALPINE_VERSION=3.16
ARG PHP_VERSION=8.2

########
# base #
Expand Down
4 changes: 2 additions & 2 deletions php/m4/php-fpm.m4
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
include(`macros.m4')
DONT_CHANGE()

ARG ALPINE_VERSION=3.15
ARG PHP_VERSION=8.0
ARG ALPINE_VERSION=3.16
ARG PHP_VERSION=8.2

########
# base #
Expand Down
4 changes: 2 additions & 2 deletions php/m4/php-zts.m4
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
include(`macros.m4')
DONT_CHANGE()

ARG ALPINE_VERSION=3.15
ARG PHP_VERSION=8.0
ARG ALPINE_VERSION=3.16
ARG PHP_VERSION=8.2

########
# base #
Expand Down
53 changes: 26 additions & 27 deletions php/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,38 +11,37 @@ dockerfiles:
done

docker-build:
PHP_VERSION=7.4; PHP_TARGET=cli; DOCKER_REGISTRY=prooph/; docker-compose build
PHP_VERSION=8.0; PHP_TARGET=cli; DOCKER_REGISTRY=prooph/; docker-compose build
PHP_VERSION=8.1; PHP_TARGET=cli; DOCKER_REGISTRY=prooph/; docker-compose build
export PHP_VERSION=8.0; export PHP_TARGET=cli; export DOCKER_REGISTRY=prooph/; docker-compose build
export PHP_VERSION=8.1; export PHP_TARGET=cli; export DOCKER_REGISTRY=prooph/; docker-compose build
export PHP_VERSION=8.2; export PHP_TARGET=cli; export DOCKER_REGISTRY=prooph/; docker-compose build

PHP_VERSION=7.4; PHP_TARGET=fpm; DOCKER_REGISTRY=prooph/; docker-compose build
PHP_VERSION=8.0; PHP_TARGET=fpm; DOCKER_REGISTRY=prooph/; docker-compose build
PHP_VERSION=8.1; PHP_TARGET=fpm; DOCKER_REGISTRY=prooph/; docker-compose build
export PHP_VERSION=8.0; export PHP_TARGET=fpm; export DOCKER_REGISTRY=prooph/; docker-compose build
export PHP_VERSION=8.1; export PHP_TARGET=fpm; export DOCKER_REGISTRY=prooph/; docker-compose build
export PHP_VERSION=8.2; export PHP_TARGET=fpm; export DOCKER_REGISTRY=prooph/; docker-compose build

PHP_VERSION=7.4; PHP_TARGET=zts; DOCKER_REGISTRY=prooph/; docker-compose build
PHP_VERSION=8.0; PHP_TARGET=zts; DOCKER_REGISTRY=prooph/; docker-compose build
PHP_VERSION=8.1; PHP_TARGET=zts; DOCKER_REGISTRY=prooph/; docker-compose build
export PHP_VERSION=8.0; export PHP_TARGET=zts; export DOCKER_REGISTRY=prooph/; docker-compose build
export PHP_VERSION=8.1; export PHP_TARGET=zts; export DOCKER_REGISTRY=prooph/; docker-compose build
export PHP_VERSION=8.2; export PHP_TARGET=zts; export DOCKER_REGISTRY=prooph/; docker-compose build

docker-push:
PHP_VERSION=7.4; PHP_TARGET=cli; DOCKER_REGISTRY=prooph/; docker-compose push
PHP_VERSION=8.0; PHP_TARGET=cli; DOCKER_REGISTRY=prooph/; docker-compose push
PHP_VERSION=8.1; PHP_TARGET=cli; DOCKER_REGISTRY=prooph/; docker-compose push
export PHP_VERSION=8.0; export PHP_TARGET=cli; export DOCKER_REGISTRY=prooph/; docker-compose push
export PHP_VERSION=8.1; export PHP_TARGET=cli; export DOCKER_REGISTRY=prooph/; docker-compose push
export PHP_VERSION=8.2; export PHP_TARGET=cli; export DOCKER_REGISTRY=prooph/; docker-compose push

PHP_VERSION=7.4; PHP_TARGET=fpm; DOCKER_REGISTRY=prooph/; docker-compose push
PHP_VERSION=8.0; PHP_TARGET=fpm; DOCKER_REGISTRY=prooph/; docker-compose push
PHP_VERSION=8.1; PHP_TARGET=fpm; DOCKER_REGISTRY=prooph/; docker-compose push
export PHP_VERSION=8.0; export PHP_TARGET=fpm; export DOCKER_REGISTRY=prooph/; docker-compose push
export PHP_VERSION=8.1; export PHP_TARGET=fpm; export DOCKER_REGISTRY=prooph/; docker-compose push
export PHP_VERSION=8.2; export PHP_TARGET=fpm; export DOCKER_REGISTRY=prooph/; docker-compose push

PHP_VERSION=7.4; PHP_TARGET=zts; DOCKER_REGISTRY=prooph/; docker-compose push
PHP_VERSION=8.0; PHP_TARGET=zts; DOCKER_REGISTRY=prooph/; docker-compose push
PHP_VERSION=8.1; PHP_TARGET=zts; DOCKER_REGISTRY=prooph/; docker-compose push
export PHP_VERSION=8.0; export PHP_TARGET=zts; export DOCKER_REGISTRY=prooph/; docker-compose push
export PHP_VERSION=8.1; export PHP_TARGET=zts; export DOCKER_REGISTRY=prooph/; docker-compose push
export PHP_VERSION=8.2; export PHP_TARGET=zts; export DOCKER_REGISTRY=prooph/; docker-compose push

docker-pull:
docker pull php:7.4-cli-alpine3.15
docker pull php:8.0-cli-alpine3.15
docker pull php:8.1-cli-alpine3.15
docker pull php:7.4-fpm-alpine3.15
docker pull php:8.0-fpm-alpine3.15
docker pull php:8.1-fpm-alpine3.15
docker pull php:7.4-zts-alpine3.15
docker pull php:8.0-zts-alpine3.15
docker pull php:8.1-zts-alpine3.15
docker pull php:8.0-cli-alpine3.16
docker pull php:8.1-cli-alpine3.16
docker pull php:8.0-fpm-alpine3.16
docker pull php:8.1-fpm-alpine3.16
docker pull php:8.2-fpm-alpine3.16
docker pull php:8.0-zts-alpine3.16
docker pull php:8.1-zts-alpine3.16
docker pull php:8.2-zts-alpine3.16
12 changes: 7 additions & 5 deletions php/php-cli
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# DO NOT MODIFY THIS AUTOGENERATED FILE
# Change it in m4 folder
ARG ALPINE_VERSION=3.15
ARG PHP_VERSION=8.0
ARG ALPINE_VERSION=3.16
ARG PHP_VERSION=8.2
########
# base #
########
Expand All @@ -27,7 +27,8 @@ ENV PHPIZE_DEPS \
libxslt-dev \
# for intl extension
icu-dev \
openssl-dev
openssl-dev \
linux-headers
RUN apk add --no-cache --virtual .persistent-deps \
# for intl extension
icu-libs \
Expand Down Expand Up @@ -177,7 +178,8 @@ ENV PHPIZE_DEPS \
gcc \
make \
pkgconf \
re2c
re2c \
linux-headers
RUN set -xe \
&& apk add --no-cache --virtual .build-deps \
$PHPIZE_DEPS \
Expand All @@ -191,7 +193,7 @@ COPY config/xdebug-cli.ini /usr/local/etc/php/conf.d/
FROM php-cli as composer-cli
# Environmental Variables
ENV COMPOSER_HOME=/root/composer
ARG COMPOSER_VERSION=2.3.7
ARG COMPOSER_VERSION=2.5.4
ENV COMPOSER_ALLOW_SUPERUSER=1
RUN set -xe \
# use own name or other previous .persistent-deps will be removed
Expand Down
12 changes: 7 additions & 5 deletions php/php-fpm
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# DO NOT MODIFY THIS AUTOGENERATED FILE
# Change it in m4 folder
ARG ALPINE_VERSION=3.15
ARG PHP_VERSION=8.0
ARG ALPINE_VERSION=3.16
ARG PHP_VERSION=8.2
########
# base #
########
Expand All @@ -27,7 +27,8 @@ ENV PHPIZE_DEPS \
libxslt-dev \
# for intl extension
icu-dev \
openssl-dev
openssl-dev \
linux-headers
RUN apk add --no-cache --virtual .persistent-deps \
# for intl extension
icu-libs \
Expand Down Expand Up @@ -177,7 +178,8 @@ ENV PHPIZE_DEPS \
gcc \
make \
pkgconf \
re2c
re2c \
linux-headers
RUN set -xe \
&& apk add --no-cache --virtual .build-deps \
$PHPIZE_DEPS \
Expand All @@ -191,7 +193,7 @@ COPY config/xdebug.ini /usr/local/etc/php/conf.d/
FROM php-fpm as composer-fpm
# Environmental Variables
ENV COMPOSER_HOME=/root/composer
ARG COMPOSER_VERSION=2.3.7
ARG COMPOSER_VERSION=2.5.4
ENV COMPOSER_ALLOW_SUPERUSER=1
RUN set -xe \
# use own name or other previous .persistent-deps will be removed
Expand Down
12 changes: 7 additions & 5 deletions php/php-zts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# DO NOT MODIFY THIS AUTOGENERATED FILE
# Change it in m4 folder
ARG ALPINE_VERSION=3.15
ARG PHP_VERSION=8.0
ARG ALPINE_VERSION=3.16
ARG PHP_VERSION=8.2
########
# base #
########
Expand All @@ -27,7 +27,8 @@ ENV PHPIZE_DEPS \
libxslt-dev \
# for intl extension
icu-dev \
openssl-dev
openssl-dev \
linux-headers
RUN apk add --no-cache --virtual .persistent-deps \
# for intl extension
icu-libs \
Expand Down Expand Up @@ -163,7 +164,8 @@ ENV PHPIZE_DEPS \
gcc \
make \
pkgconf \
re2c
re2c \
linux-headers
RUN set -xe \
&& apk add --no-cache --virtual .build-deps \
$PHPIZE_DEPS \
Expand All @@ -177,7 +179,7 @@ COPY config/xdebug-cli.ini /usr/local/etc/php/conf.d/
FROM php-zts as composer-zts
# Environmental Variables
ENV COMPOSER_HOME=/root/composer
ARG COMPOSER_VERSION=2.3.7
ARG COMPOSER_VERSION=2.5.4
ENV COMPOSER_ALLOW_SUPERUSER=1
RUN set -xe \
# use own name or other previous .persistent-deps will be removed
Expand Down

0 comments on commit 3d954ca

Please sign in to comment.