commit 7976965bb9c7935610e5c68ff1b5859816118db786defcbcbb80cb8cd5cb665c Author: Dan Čermák Date: Thu Jul 6 10:40:09 2023 +0000 [info=346ceb718bab06b4c190b0e82763a63b] OBS-URL: https://build.opensuse.org/package/show/devel:BCI:Tumbleweed/php-fpm8-image?expand=0&rev=1 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..9466562 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,65 @@ +# SPDX-License-Identifier: MIT +#!BuildTag: opensuse/bci/php-fpm:8 +#!BuildTag: opensuse/bci/php-fpm:8-%RELEASE% + +FROM opensuse/tumbleweed:latest + +MAINTAINER openSUSE (https://www.opensuse.org/) + +# Define labels according to https://en.opensuse.org/Building_derived_containers +# labelprefix=org.opensuse.bci.php-fpm +LABEL org.opencontainers.image.title="openSUSE Tumbleweed BCI PHP-FPM 8" +LABEL org.opencontainers.image.description="PHP-FPM 8 container based on the openSUSE Tumbleweed Base Container Image." +LABEL org.opencontainers.image.version="8" +LABEL org.opencontainers.image.url="https://www.opensuse.org" +LABEL org.opencontainers.image.created="%BUILDTIME%" +LABEL org.opencontainers.image.vendor="openSUSE Project" +LABEL org.opencontainers.image.source="%SOURCEURL%" +LABEL org.opensuse.reference="registry.opensuse.org/opensuse/bci/php-fpm:8-%RELEASE%" +LABEL org.openbuildservice.disturl="%DISTURL%" +LABEL org.opensuse.lifecycle-url="https://en.opensuse.org/Lifetime" +LABEL org.opensuse.release-stage="released" + +# endlabelprefix + +RUN set -euo pipefail; zypper -n in php8 php8-cli php-composer2 php8-curl php8-zip php8-zlib php8-phar php8-mbstring php8-fpm; zypper -n clean; rm -rf /var/log/* +ENV PHP_VERSION="%%php_version%%" +ENV PHP_INI_DIR="/etc/php8/" +ENV PHPIZE_DEPS="php8-devel awk make" +ENV COMPOSER_VERSION="%%composer_version%%" + +ENTRYPOINT ["docker-php-entrypoint"] +CMD ["php-fpm"] +COPY docker-php-source docker-php-entrypoint docker-php-ext-configure docker-php-ext-enable docker-php-ext-install /usr/local/bin/ +RUN chmod +x /usr/local/bin/docker-php-* +WORKDIR /srv/www/htdocs + +RUN set -euo pipefail; \ + cd /etc/php8/fpm/; \ + test -e php-fpm.d/www.conf.default && cp -p php-fpm.d/www.conf.default php-fpm.d/www.conf; \ + test -e php-fpm.conf.default && cp -p php-fpm.conf.default php-fpm.conf; \ + { \ + echo '[global]'; \ + echo 'error_log = /proc/self/fd/2'; \ + echo; echo '; https://github.com/docker-library/php/pull/725#issuecomment-443540114'; echo 'log_limit = 8192'; \ + echo; \ + echo '[www]'; \ + echo '; if we send this to /proc/self/fd/1, it never appears'; \ + echo 'access.log = /proc/self/fd/2'; \ + echo; \ + echo 'clear_env = no'; \ + echo; \ + echo '; Ensure worker stdout and stderr are sent to the main error log.'; \ + echo 'catch_workers_output = yes'; \ + echo 'decorate_workers_output = no'; \ + } | tee php-fpm.d/docker.conf; \ + { \ + echo '[global]'; \ + echo 'daemonize = no'; \ + } | tee php-fpm.d/zz-docker.conf + +# Override stop signal to stop process gracefully +# https://github.com/php/php-src/blob/17baa87faddc2550def3ae7314236826bc1b1398/sapi/fpm/php-fpm.8.in#L163 +STOPSIGNAL SIGQUIT + +EXPOSE 9000 diff --git a/_service b/_service new file mode 100644 index 0000000..5f96c7a --- /dev/null +++ b/_service @@ -0,0 +1,14 @@ + + + + + Dockerfile + %%composer_version%% + php-composer2 + + + Dockerfile + %%php_version%% + php8 + + \ No newline at end of file diff --git a/docker-php-entrypoint b/docker-php-entrypoint new file mode 100644 index 0000000..67fa328 --- /dev/null +++ b/docker-php-entrypoint @@ -0,0 +1,9 @@ +#!/bin/sh +set -e + +# first arg is `-f` or `--some-option` +if [ "${1#-}" != "$1" ]; then + set -- php-fpm "$@" +fi + +exec "$@" diff --git a/docker-php-ext-configure b/docker-php-ext-configure new file mode 100644 index 0000000..9c08ffa --- /dev/null +++ b/docker-php-ext-configure @@ -0,0 +1,2 @@ +#!/bin/sh +echo "This script is not required in this PHP container." diff --git a/docker-php-ext-enable b/docker-php-ext-enable new file mode 100644 index 0000000..9c08ffa --- /dev/null +++ b/docker-php-ext-enable @@ -0,0 +1,2 @@ +#!/bin/sh +echo "This script is not required in this PHP container." diff --git a/docker-php-ext-install b/docker-php-ext-install new file mode 100644 index 0000000..1f9c642 --- /dev/null +++ b/docker-php-ext-install @@ -0,0 +1,10 @@ +#!/bin/bash +set -euo pipefail + +extensions=() + +for ext in $@; do + [[ "$ext" =~ ^- ]] || extensions+=("php8-$ext") +done + +zypper -n in ${extensions[*]} diff --git a/docker-php-source b/docker-php-source new file mode 100644 index 0000000..9c08ffa --- /dev/null +++ b/docker-php-source @@ -0,0 +1,2 @@ +#!/bin/sh +echo "This script is not required in this PHP container." diff --git a/php-fpm8-image.changes b/php-fpm8-image.changes new file mode 100644 index 0000000..9a8e6f1 --- /dev/null +++ b/php-fpm8-image.changes @@ -0,0 +1,4 @@ +------------------------------------------------------------------- +Thu Jul 06 09:56:51 UTC 2023 - SUSE Update Bot + +- First version of the PHP-FPM 8 BCI