Skip to content

Commit

Permalink
Merge pull request #497 from SUSE/for-deploy-Tumbleweed
Browse files Browse the repository at this point in the history
🤖: Update build recipes for Tumbleweed
  • Loading branch information
dirkmueller authored Jul 6, 2023
2 parents d280b3d + 46ef3b4 commit d0da13e
Show file tree
Hide file tree
Showing 25 changed files with 298 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .obs/workflows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,18 @@ staging_build:
source_project: home:defolos:BCI:CR:Tumbleweed
source_package: openjdk-20-image
target_project: home:defolos:BCI:CR:Tumbleweed:Staging
- branch_package:
source_project: home:defolos:BCI:CR:Tumbleweed
source_package: php8-image
target_project: home:defolos:BCI:CR:Tumbleweed:Staging
- branch_package:
source_project: home:defolos:BCI:CR:Tumbleweed
source_package: php-apache8-image
target_project: home:defolos:BCI:CR:Tumbleweed:Staging
- branch_package:
source_project: home:defolos:BCI:CR:Tumbleweed
source_package: php-fpm8-image
target_project: home:defolos:BCI:CR:Tumbleweed:Staging
- branch_package:
source_project: home:defolos:BCI:CR:Tumbleweed
source_package: init-image
Expand Down Expand Up @@ -202,6 +214,15 @@ refresh_devel_BCI:
- trigger_services:
project: devel:BCI:Tumbleweed
package: openjdk-20-image
- trigger_services:
project: devel:BCI:Tumbleweed
package: php8-image
- trigger_services:
project: devel:BCI:Tumbleweed
package: php-apache8-image
- trigger_services:
project: devel:BCI:Tumbleweed
package: php-fpm8-image
- trigger_services:
project: devel:BCI:Tumbleweed
package: init-image
Expand Down
49 changes: 49 additions & 0 deletions php-apache8-image/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# SPDX-License-Identifier: MIT
#!BuildTag: opensuse/bci/php-apache:8
#!BuildTag: opensuse/bci/php-apache: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-apache
LABEL org.opencontainers.image.title="openSUSE Tumbleweed BCI PHP-Apache 8"
LABEL org.opencontainers.image.description="PHP-Apache 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-apache: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 apache2-mod_php8; 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%%"
ENV APACHE_CONFDIR="/etc/apache2"
ENV APACHE_ENVVARS="/usr/sbin/envvars"

ENTRYPOINT ["docker-php-entrypoint"]
CMD ["apache2-foreground"]
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-*

STOPSIGNAL SIGWINCH

# create our own apache2-foreground from the systemd startup script
RUN sed 's|^exec $apache_bin|exec $apache_bin -DFOREGROUND|' /usr/sbin/start_apache2 > /usr/local/bin/apache2-foreground
RUN chmod +x /usr/local/bin/apache2-foreground

# apache fails to start without its log folder
RUN mkdir -p /var/log/apache2

WORKDIR /srv/www/htdocs

EXPOSE 80
14 changes: 14 additions & 0 deletions php-apache8-image/_service
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<services>
<service mode="buildtime" name="docker_label_helper"/>
<service mode="buildtime" name="kiwi_metainfo_helper"/>
<service name="replace_using_package_version" mode="buildtime">
<param name="file">Dockerfile</param>
<param name="regex">%%composer_version%%</param>
<param name="package">php-composer2</param>
</service>
<service name="replace_using_package_version" mode="buildtime">
<param name="file">Dockerfile</param>
<param name="regex">%%php_version%%</param>
<param name="package">php8</param>
</service>
</services>
9 changes: 9 additions & 0 deletions php-apache8-image/docker-php-entrypoint
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/sh
set -e

# first arg is `-f` or `--some-option`
if [ "${1#-}" != "$1" ]; then
set -- apache2-foreground "$@"
fi

exec "$@"
2 changes: 2 additions & 0 deletions php-apache8-image/docker-php-ext-configure
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
echo "This script is not required in this PHP container."
2 changes: 2 additions & 0 deletions php-apache8-image/docker-php-ext-enable
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
echo "This script is not required in this PHP container."
10 changes: 10 additions & 0 deletions php-apache8-image/docker-php-ext-install
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash
set -euo pipefail

extensions=()

for ext in $@; do
[[ "$ext" =~ ^- ]] || extensions+=("php8-$ext")
done

zypper -n in ${extensions[*]}
2 changes: 2 additions & 0 deletions php-apache8-image/docker-php-source
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
echo "This script is not required in this PHP container."
4 changes: 4 additions & 0 deletions php-apache8-image/php-apache8-image.changes
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
-------------------------------------------------------------------
Thu Jul 06 09:56:51 UTC 2023 - SUSE Update Bot <[email protected]>

- First version of the PHP-Apache 8 BCI
65 changes: 65 additions & 0 deletions php-fpm8-image/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
14 changes: 14 additions & 0 deletions php-fpm8-image/_service
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<services>
<service mode="buildtime" name="docker_label_helper"/>
<service mode="buildtime" name="kiwi_metainfo_helper"/>
<service name="replace_using_package_version" mode="buildtime">
<param name="file">Dockerfile</param>
<param name="regex">%%composer_version%%</param>
<param name="package">php-composer2</param>
</service>
<service name="replace_using_package_version" mode="buildtime">
<param name="file">Dockerfile</param>
<param name="regex">%%php_version%%</param>
<param name="package">php8</param>
</service>
</services>
9 changes: 9 additions & 0 deletions php-fpm8-image/docker-php-entrypoint
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/sh
set -e

# first arg is `-f` or `--some-option`
if [ "${1#-}" != "$1" ]; then
set -- php-fpm "$@"
fi

exec "$@"
2 changes: 2 additions & 0 deletions php-fpm8-image/docker-php-ext-configure
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
echo "This script is not required in this PHP container."
2 changes: 2 additions & 0 deletions php-fpm8-image/docker-php-ext-enable
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
echo "This script is not required in this PHP container."
10 changes: 10 additions & 0 deletions php-fpm8-image/docker-php-ext-install
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash
set -euo pipefail

extensions=()

for ext in $@; do
[[ "$ext" =~ ^- ]] || extensions+=("php8-$ext")
done

zypper -n in ${extensions[*]}
2 changes: 2 additions & 0 deletions php-fpm8-image/docker-php-source
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
echo "This script is not required in this PHP container."
4 changes: 4 additions & 0 deletions php-fpm8-image/php-fpm8-image.changes
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
-------------------------------------------------------------------
Thu Jul 06 09:56:51 UTC 2023 - SUSE Update Bot <[email protected]>

- First version of the PHP-FPM 8 BCI
34 changes: 34 additions & 0 deletions php8-image/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# SPDX-License-Identifier: MIT
#!BuildTag: opensuse/bci/php:8
#!BuildTag: opensuse/bci/php: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
LABEL org.opencontainers.image.title="openSUSE Tumbleweed BCI PHP 8"
LABEL org.opencontainers.image.description="PHP 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: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; 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", "-a"]
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-*
14 changes: 14 additions & 0 deletions php8-image/_service
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<services>
<service mode="buildtime" name="docker_label_helper"/>
<service mode="buildtime" name="kiwi_metainfo_helper"/>
<service name="replace_using_package_version" mode="buildtime">
<param name="file">Dockerfile</param>
<param name="regex">%%composer_version%%</param>
<param name="package">php-composer2</param>
</service>
<service name="replace_using_package_version" mode="buildtime">
<param name="file">Dockerfile</param>
<param name="regex">%%php_version%%</param>
<param name="package">php8</param>
</service>
</services>
9 changes: 9 additions & 0 deletions php8-image/docker-php-entrypoint
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/sh
set -e

# first arg is `-f` or `--some-option`
if [ "${1#-}" != "$1" ]; then
set -- php "$@"
fi

exec "$@"
2 changes: 2 additions & 0 deletions php8-image/docker-php-ext-configure
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
echo "This script is not required in this PHP container."
2 changes: 2 additions & 0 deletions php8-image/docker-php-ext-enable
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
echo "This script is not required in this PHP container."
10 changes: 10 additions & 0 deletions php8-image/docker-php-ext-install
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash
set -euo pipefail

extensions=()

for ext in $@; do
[[ "$ext" =~ ^- ]] || extensions+=("php8-$ext")
done

zypper -n in ${extensions[*]}
2 changes: 2 additions & 0 deletions php8-image/docker-php-source
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
echo "This script is not required in this PHP container."
4 changes: 4 additions & 0 deletions php8-image/php8-image.changes
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
-------------------------------------------------------------------
Thu Jul 06 09:56:51 UTC 2023 - SUSE Update Bot <[email protected]>

- First version of the PHP 8 BCI

0 comments on commit d0da13e

Please sign in to comment.