Skip to content

Commit 6e6b46f

Browse files
committed
Add PHP 8.3
1 parent 69953a1 commit 6e6b46f

File tree

6 files changed

+173
-21
lines changed

6 files changed

+173
-21
lines changed

.github/workflows/php-83.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: PHP 8.3
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches: [ main ]
7+
paths:
8+
- 8.3/**
9+
release:
10+
types: [ published ]
11+
12+
jobs:
13+
push_to_registry:
14+
strategy:
15+
matrix:
16+
image:
17+
- name: "[8.3][base]"
18+
target: "base"
19+
context: 8.3
20+
tags: |
21+
jopplt/php:8.3-fpm-base
22+
build-args: |
23+
COMPOSER_VERSION=2.7.1
24+
platforms: linux/amd64,linux/arm64
25+
- name: "[8.3][newrelic]"
26+
target: "newrelic"
27+
context: 8.3
28+
tags: |
29+
jopplt/php:8.3-fpm-newrelic
30+
build-args: |
31+
NEW_RELIC_AGENT_VERSION=10.18.0.8
32+
platforms: linux/amd64
33+
- name: "[8.3][dev]"
34+
target: "dev"
35+
context: 8.3
36+
tags: |
37+
jopplt/php:8.3-fpm-dev
38+
build-args: |
39+
COMPOSER_VERSION=2.7.1
40+
platforms: linux/amd64,linux/arm64
41+
fail-fast: true
42+
runs-on: ubuntu-22.04
43+
steps:
44+
- uses: actions/checkout@v2
45+
- name: Set up QEMU
46+
uses: docker/setup-qemu-action@master
47+
with:
48+
platforms: all
49+
- name: Set up Docker Buildx
50+
id: buildx
51+
uses: docker/setup-buildx-action@master
52+
- name: Log in to Docker Hub
53+
uses: docker/login-action@v1
54+
with:
55+
username: ${{ secrets.DOCKER_USERNAME }}
56+
password: ${{ secrets.DOCKER_PASSWORD }}
57+
- name: "${{ matrix.image.name }}"
58+
uses: docker/build-push-action@v2
59+
with:
60+
builder: ${{ steps.buildx.outputs.name }}
61+
context: ${{ matrix.image.context }}
62+
target: ${{ matrix.image.target }}
63+
platforms: ${{ matrix.image.platforms }}
64+
push: true
65+
tags: ${{ matrix.image.tags }}
66+
build-args: ${{ matrix.image.build-args }}

8.3/Dockerfile

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
FROM php:8.3.8-fpm-alpine3.20 AS base
2+
ARG COMPOSER_VERSION=2.7.7
3+
WORKDIR /app
4+
VOLUME /app
5+
COPY config/php.ini /usr/local/etc/php/php.ini
6+
RUN apk --update add --no-cache --virtual .build-deps \
7+
build-base \
8+
autoconf \
9+
# Base packages
10+
&& apk --update add --no-cache \
11+
bash \
12+
nodejs \
13+
freetype-dev libpng-dev libjpeg-turbo-dev \
14+
icu-dev \
15+
libzip-dev zip \
16+
# Additional extensions
17+
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
18+
&& docker-php-ext-install -j$(nproc) \
19+
exif \
20+
gd \
21+
intl \
22+
bcmath \
23+
mysqli \
24+
pdo \
25+
pdo_mysql \
26+
opcache \
27+
zip \
28+
&& pecl install -o -f redis \
29+
&& docker-php-ext-enable \
30+
redis \
31+
# Composer
32+
&& curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer --version=${COMPOSER_VERSION} \
33+
# Cleanup
34+
&& apk del .build-deps
35+
36+
FROM base AS newrelic
37+
ARG NEW_RELIC_AGENT_VERSION=10.21.0.11
38+
ARG NR_INSTALL_USE_CP_NOT_LN=1
39+
ARG NR_INSTALL_SILENT=1
40+
RUN apk --update add --no-cache libstdc++ gcompat
41+
RUN curl -L https://download.newrelic.com/php_agent/archive/${NEW_RELIC_AGENT_VERSION}/newrelic-php5-${NEW_RELIC_AGENT_VERSION}-linux-musl.tar.gz | tar -C $HOME -zx \
42+
&& $HOME/newrelic-php5-${NEW_RELIC_AGENT_VERSION}-linux-musl/newrelic-install install \
43+
&& rm -rf $HOME/newrelic-php5-* $HOME/nrinstall*
44+
45+
FROM base AS dev
46+
COPY config/xdebug.ini /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
47+
RUN apk --update add --no-cache --virtual .build-deps \
48+
# Build dependencies
49+
build-base \
50+
gcc \
51+
autoconf \
52+
linux-headers \
53+
&& apk --update add --no-cache \
54+
# Dev packages
55+
php83-pecl-xdebug \
56+
sqlite \
57+
mysql-client \
58+
&& pecl install \
59+
xdebug \
60+
# Cleanup
61+
&& apk del .build-deps

8.3/config/newrelic.ini

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
extension = "newrelic.so"
2+
[newrelic]
3+
newrelic.license = "$NEW_RELIC_LICENSE"
4+
newrelic.logfile = "/var/log/newrelic/php_agent.log"
5+
newrelic.appname="$NEW_RELIC_APP_NAME"
6+
newrelic.daemon.logfile = "/var/log/newrelic/newrelic-daemon.log"
7+
newrelic.distributed_tracing_enabled=true
8+
newrelic.daemon.address="newrelic-php-daemon:31339"

8.3/config/php.ini

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
opcache.memory_consumption=256
2+
opcache.max_accelerated_files = 20000
3+
realpath_cache_size = 4096K
4+
realpath_cache_ttl = 600

8.3/config/xdebug.ini

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
zend_extension=xdebug.so
2+
xdebug.mode=debug
3+
xdebug.start_with_request=yes
4+
xdebug.client_host=host.docker.internal

README.md

Lines changed: 30 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,69 +4,78 @@ PHP docker image for php/mysql developers.
44
Link to DockerHub: https://hub.docker.com/r/jopplt/php/tags
55

66
## Tags
7-
### `8.2-fpm-min`: Minimal PHP 8.2 fpm
7+
### `8.3-fpm-base`: Base image for PHP development
88
```
9-
docker pull jopplt/php:8.2-fpm-min
9+
docker pull jopplt/php:8.3-fpm-base
1010
```
11+
Bundled with:
12+
* Composer
13+
* Node
14+
1115
Includes the following extensions:
12-
* `pdo_mysql`
13-
* `opcache`
1416
* `exif`
1517
* `gd`
18+
* `intl`
19+
* `mysqli`
20+
* `pdo`
21+
* `pdo_mysql`
22+
* `opcache`
23+
* `zip`
1624

1725
Get a shell:
1826
```
19-
docker run --rm -it -v ${PWD}:/app jopplt/php:8.2-fpm-min sh
27+
docker run --rm -it -v ${PWD}:/app jopplt/php:8.3-fpm-base sh
2028
```
2129

2230
Custom `php.ini` configuration?:
2331
```
24-
docker run --rm -it -v ${PWD}:/app -v ${PWD}/config/php.ini:/usr/local/etc/php/php.ini jopplt/php:8.2-fpm-min sh
32+
docker run --rm -it -v ${PWD}:/app -v ${PWD}/config/php.ini:/usr/local/etc/php/php.ini jopplt/php:8.3-fpm-base sh
2533
```
2634

27-
### `8.2-fpm-dev`: PHP 8.2 fpm for development purposes
35+
### `8.3-fpm-dev`: Base image with additional tools for local development
2836
```
29-
docker pull jopplt/php:8.2-fpm-dev
37+
docker pull jopplt/php:8.3-fpm-dev
3038
```
31-
Includes:
32-
* composer
33-
* xdebug
34-
* sqlite
35-
* bash
39+
Bundled with:
40+
* Composer
41+
* Node
42+
* Xdebug
43+
* Sqlite
44+
* Bash
3645

3746
Get a shell:
3847
```
39-
docker run --rm -it -v ${PWD}:/app jopplt/php:8.2-fpm-dev bash
48+
docker run --rm -it -v ${PWD}:/app jopplt/php:8.3-fpm-dev bash
4049
```
4150

4251
Install composer dependencies on current folder (with ssh keys):
4352
```
44-
docker run --rm -v ${PWD}:/app -v ~/.ssh:/root/.ssh jopplt/php:8.2-fpm-dev composer install
53+
docker run --rm -v ${PWD}:/app -v ~/.ssh:/root/.ssh jopplt/php:8.3-fpm-dev composer install
4554
```
4655

4756
Custom `xdebug.ini` configuration?:
4857
```
49-
docker run --rm -it -v ${PWD}:/app -v ${PWD}/config/xdebug.ini:/usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini jopplt/php:8.2-fpm-dev bash
58+
docker run --rm -it -v ${PWD}:/app -v ${PWD}/config/xdebug.ini:/usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini jopplt/php:8.3-fpm-dev bash
5059
```
5160

52-
### `8.2-fpm-newrelic`: PHP 8.2 fpm with Newrelic Agent
61+
### `8.3-fpm-newrelic`: PHP 8.3 fpm with Newrelic Agent
5362
```
54-
docker pull jopplt/php:8.2-fpm-newrelic
63+
docker pull jopplt/php:8.3-fpm-newrelic
5564
```
5665

5766
Requirements:
5867
* Newrelic daemon running in a separate container. Please refer to [docs.newrelic.com](https://docs.newrelic.com/docs/apm/agents/php-agent/advanced-installation/docker-other-container-environments-install-php-agent/) for more information
5968
* `newrelic.ini` configuration
6069

6170
```
62-
docker run -d -v ${PWD}:/app -v ${PWD}/config/newrelic.ini:/usr/local/etc/php/conf.d/newrelic.ini jopplt/php:8.2-fpm-newrelic
71+
docker run -d -v ${PWD}:/app -v ${PWD}/config/newrelic.ini:/usr/local/etc/php/conf.d/newrelic.ini jopplt/php:8.3-fpm-newrelic
6372
```
6473

6574
## Local build & run
6675

6776
```
68-
docker build --tag php:8.2-fpm-dev 8.2
77+
docker build --tag php:8.3-fpm-dev 8.3
6978
```
7079
```
71-
docker run --rm -it -v ${PWD}:/app php:8.2-fpm-dev bash
80+
docker run --rm -it -v ${PWD}:/app php:8.3-fpm-dev bash
7281
```

0 commit comments

Comments
 (0)