Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add php 8.3 #66

Merged
merged 4 commits into from
Dec 27, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions .github/workflows/docker-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:

- name: php82
folder: php/8.2
arch: [linux/amd64, linux/arm64, linux/arm/v7]
arch: [ linux/amd64, linux/arm64, linux/arm/v7 ]
targets:
primary:
name: cli
Expand All @@ -70,12 +70,24 @@ jobs:
tags: phpdockerio/php:8.2-fpm
tertiary: ~

- name: php82

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo? (should be php83)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch

folder: php/8.3
arch: [ linux/amd64, linux/arm64, linux/arm/v7 ]
targets:
primary:
name: cli
tags: phpdockerio/php:8.3-cli
secondary:
name: fpm
tags: phpdockerio/php:8.3-fpm
tertiary: ~

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Debug
run: |
run: |
echo "is_master: -> ${{ github.ref == 'refs/heads/master' }} <-"
echo "ref: ${{ github.head_ref }}"

Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,10 @@ COPY --from=composer:1 /usr/bin/composer /usr/bin/composer

| PHP <br> version | Images | OS base | PHP EOL date | Daily builds |
|------------------|----------------------------------------------------------|---------------|---------------|--------------|
| 8.3 | `phpdockerio/php:8.3-cli` <br> `phpdockerio/php:8.3-fpm` | Ubuntu 22.04 | ✔ 23 Nov 2026 | ✔ |
| 8.2 | `phpdockerio/php:8.2-cli` <br> `phpdockerio/php:8.2-fpm` | Ubuntu 22.04 | ✔ 08 Dec 2025 | ✔ |
| 8.1 | `phpdockerio/php:8.1-cli` <br> `phpdockerio/php:8.1-fpm` | Ubuntu 22.04 | ✔ 25 Nov 2024 | ✔ |
| 8.0 | `phpdockerio/php:8.0-cli` <br> `phpdockerio/php:8.0-fpm` | Ubuntu 20.04 | 26 Nov 2023 | ✔ |
| 8.0 | `phpdockerio/php:8.0-cli` <br> `phpdockerio/php:8.0-fpm` | Ubuntu 20.04 | 26 Nov 2023 | ✔ |
| 7.4 | `phpdockerio/php:7.4-cli` <br> `phpdockerio/php:7.4-fpm` | Ubuntu 20.04 | ❌ 28 Nov 2022 | ✔ |
| 7.3 | `phpdockerio/php73-cli` <br> `phpdockerio/php73-cli` | Ubuntu 18.04 | ❌ 06 Dec 2021 | ❌ |
| 7.2 | `phpdockerio/php72-cli` <br> `phpdockerio/php72-cli` | Ubuntu 18.04 | ❌ 30 Nov 2020 | ❌ |
Expand All @@ -77,9 +78,9 @@ COPY --from=composer:1 /usr/bin/composer /usr/bin/composer

* Versions past EOL (end of life) are unsupported, but may still get daily builds to ensure the underlying OS packages
are up to date.
* Daily builds are turned off for versions that run on an OS base that's also EOL (for instance, Debian Jessie).
* Daily builds are turned off for versions that run on an OS base that's also EOL (for instance, Ubuntu 18.04).
* Daily builds are kept for PHP versions that have reached EOL but the base OS has not - the base OS still receives
security updates, including the PHP runtime.
security updates.
* In general, do not use any unsupported images in a production environment, regardless of whether daily builds are
still enabled. I continue to build these for absolute holdouts that haven't been able to upgrade on time.
* Old images are kept in docker hub in the interest of enabling legacy apps to run. Docker does delete images that
Expand Down
59 changes: 59 additions & 0 deletions php/8.3/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
############################################
# PHPDocker.io PHP 8.3 / CLI and FPM image #
############################################

### CLI ###

FROM ubuntu:jammy AS cli

# Fixes some weird terminal issues such as broken clear / CTRL+L
ENV TERM=linux

# Ensure apt doesn't ask questions when installing stuff
ENV DEBIAN_FRONTEND=noninteractive

# Install Ondrej repos for Ubuntu jammy, PHP, composer and selected extensions - better selection than
# the distro's packages
RUN apt-get update \
&& apt-get install -y --no-install-recommends gnupg \
&& echo "deb http://ppa.launchpad.net/ondrej/php/ubuntu jammy main" > /etc/apt/sources.list.d/ondrej-php.list \
&& apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 4F4EA0AAE5267A6C \
&& apt-get update \
&& apt-get -y --no-install-recommends install \
ca-certificates \
curl \
unzip \
php8.3-apcu \
php8.3-cli \
php8.3-curl \
php8.3-mbstring \
php8.3-opcache \
php8.3-readline \
php8.3-xml \
php8.3-zip \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/* ~/.composer

COPY --from=composer:2 /usr/bin/composer /usr/bin/composer

CMD ["php", "-a"]

### FPM ###

FROM cli AS fpm

# Install FPM
RUN apt-get update \
&& apt-get -y --no-install-recommends install php8.3-fpm \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/*

STOPSIGNAL SIGQUIT

# PHP-FPM packages need a nudge to make them docker-friendly
COPY overrides.conf /etc/php/8.3/fpm/pool.d/z-overrides.conf

CMD ["/usr/sbin/php-fpm8.3", "-O" ]

# Open up fcgi port
EXPOSE 9000
7 changes: 7 additions & 0 deletions php/8.3/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# PHPDocker.io - PHP 8.3 / CLI, FPM and Swoole container images

Ubuntu 22.04 PHP 8.3 CLI and FPM container images for [PHPDocker.io](http://phpdocker.io) projects. Packages are provided by [Ondřej Surý](https://deb.sury.org/).

Far smaller in size than PHP's official container. No need to compile any extensions: simply run `apt-get install php8.3-EXTENSION_NAME` as part of your Dockerfile

*Note on logging:* configure your application to stream logs into `php://stdout`. That's it.
27 changes: 27 additions & 0 deletions php/8.3/overrides.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[global]
; Override default pid file
pid = /run/php-fpm.pid

; Avoid logs being sent to syslog
error_log = /proc/self/fd/2

; Set this to php default's max_execution_time to allow children to stop gracefully when fpm is commanded to stop
; This helps avoiding 502's
process_control_timeout = 30

; Do not daemonize (eg send process to the background)
daemonize = no

[www]
; Access from webserver container is via network, not socket file
listen = [::]:9000

; Redirect logs to stdout - FPM closes /dev/std* on startup
access.log = /proc/self/fd/2
catch_workers_output = yes

; Remove "pool www" decoration from log output
decorate_workers_output = no

; Required to allow config-by-environment
clear_env = no
Loading