diff --git a/.drone.star b/.drone.star index c306020..4275136 100644 --- a/.drone.star +++ b/.drone.star @@ -2,6 +2,7 @@ def main(ctx): versions = [ "latest", "20.04", + "22.04", ] arches = [ diff --git a/README.md b/README.md index efbbe7c..e733611 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,7 @@ ownCloud Docker PHP and webserver base image. ## Docker Tags and respective Dockerfile links - [`latest`](https://github.com/owncloud-docker/php/blob/master/latest/Dockerfile.amd64) available as `owncloud/php:latest` +- [`22.04`](https://github.com/owncloud-docker/php/blob/master/v22.04/Dockerfile.amd64) available as `owncloud/php:22.04` - [`20.04`](https://github.com/owncloud-docker/php/blob/master/v20.04/Dockerfile.amd64) available as `owncloud/php:20.04` ## Default volumes diff --git a/v20.04/Dockerfile.amd64 b/v20.04/Dockerfile.amd64 index a93b4ae..6922022 100644 --- a/v20.04/Dockerfile.amd64 +++ b/v20.04/Dockerfile.amd64 @@ -52,5 +52,7 @@ RUN apt-get update -y && \ apt-get -y --purge autoremove && \ apt-get clean +RUN php --version + COPY ./overlay / WORKDIR /var/www/html diff --git a/v22.04/Dockerfile.amd64 b/v22.04/Dockerfile.amd64 new file mode 100644 index 0000000..870fe65 --- /dev/null +++ b/v22.04/Dockerfile.amd64 @@ -0,0 +1,61 @@ +FROM owncloud/ubuntu:22.04-amd64@sha256:18fca29f1520f6d07488e108c24952420d71ca07a8af37cf00c01a038154958c + +LABEL maintainer="ownCloud GmbH " \ + org.opencontainers.image.authors="ownCloud DevOps " \ + org.opencontainers.image.title="ownCloud PHP" \ + org.opencontainers.image.url="https://hub.docker.com/r/owncloud/php" \ + org.opencontainers.image.source="https://github.com/owncloud-docker/php" \ + org.opencontainers.image.documentation="https://github.com/owncloud-docker/php" + +EXPOSE 8080 + +ENTRYPOINT ["/usr/bin/entrypoint"] +CMD ["/usr/bin/server"] + +RUN apt-get update -y && \ + apt-get install -y \ + apache2 \ + libapache2-mod-php \ + php-gd \ + php-json \ + php-mysql \ + php-sqlite3 \ + php-pgsql \ + php-curl \ + php-intl \ + php-imagick \ + php-zip \ + php-xml \ + php-mbstring \ + php-soap \ + php-ldap \ + php-apcu \ + php-redis \ + php-dev libsmbclient-dev \ + php-gmp \ + smbclient \ + patch \ + mysql-client \ + postgresql-client \ + sqlite && \ + apt-get clean + +RUN php --version + +RUN ls -l /etc/php + +RUN pecl install smbclient-stable && \ + echo 'extension=smbclient.so' > /etc/php/7.4/mods-available/smbclient.ini && \ + phpenmod smbclient && \ + rm -rf /var/lib/apt/lists/* /etc/apache2/envvars /etc/apache2/conf-* /etc/apache2/sites-* /var/log/apache2/* && \ + a2enmod rewrite headers env dir mime expires remoteip && \ + mkdir -p /var/www/html && \ + chown -R www-data:www-data /var/www/html /var/log/apache2 /var/run/apache2 && \ + chsh -s /bin/bash www-data && \ + curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin --filename=composer && \ + apt-get purge -y php-dev libsmbclient-dev && \ + apt-get -y --purge autoremove && \ + apt-get clean + +COPY ./overlay / +WORKDIR /var/www/html diff --git a/v22.04/Dockerfile.arm32v7 b/v22.04/Dockerfile.arm32v7 new file mode 100644 index 0000000..d71be9d --- /dev/null +++ b/v22.04/Dockerfile.arm32v7 @@ -0,0 +1,56 @@ +FROM owncloud/ubuntu:22.04-arm32v7@sha256:63271986cfe8f0b373e5fd3b4a69a13c2ae48c2665837b0ed1eb1249ac698324 + +LABEL maintainer="ownCloud GmbH " \ + org.opencontainers.image.authors="ownCloud DevOps " \ + org.opencontainers.image.title="ownCloud PHP" \ + org.opencontainers.image.url="https://hub.docker.com/r/owncloud/php" \ + org.opencontainers.image.source="https://github.com/owncloud-docker/php" \ + org.opencontainers.image.documentation="https://github.com/owncloud-docker/php" + +EXPOSE 8080 + +ENTRYPOINT ["/usr/bin/entrypoint"] +CMD ["/usr/bin/server"] + +RUN apt-get update -y && \ + apt-get install -y \ + apache2 \ + libapache2-mod-php \ + php-gd \ + php-json \ + php-mysql \ + php-sqlite3 \ + php-pgsql \ + php-curl \ + php-intl \ + php-imagick \ + php-zip \ + php-xml \ + php-mbstring \ + php-soap \ + php-ldap \ + php-apcu \ + php-redis \ + php-dev libsmbclient-dev \ + php-gmp \ + smbclient \ + patch \ + mysql-client \ + postgresql-client \ + sqlite && \ + apt-get clean && \ + pecl install smbclient-stable && \ + echo 'extension=smbclient.so' > /etc/php/7.4/mods-available/smbclient.ini && \ + phpenmod smbclient && \ + rm -rf /var/lib/apt/lists/* /etc/apache2/envvars /etc/apache2/conf-* /etc/apache2/sites-* /var/log/apache2/* && \ + a2enmod rewrite headers env dir mime expires remoteip && \ + mkdir -p /var/www/html && \ + chown -R www-data:www-data /var/www/html /var/log/apache2 /var/run/apache2 && \ + chsh -s /bin/bash www-data && \ + curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin --filename=composer && \ + apt-get purge -y php-dev libsmbclient-dev && \ + apt-get -y --purge autoremove && \ + apt-get clean + +COPY ./overlay / +WORKDIR /var/www/html diff --git a/v22.04/Dockerfile.arm64v8 b/v22.04/Dockerfile.arm64v8 new file mode 100644 index 0000000..57478e1 --- /dev/null +++ b/v22.04/Dockerfile.arm64v8 @@ -0,0 +1,56 @@ +FROM owncloud/ubuntu:22.04-arm64v8@sha256:c1693a7781cb7f5e8c2dfd5788cf9db4a47b64f8e5e2e1ab4d4c2a2c5f8799eb + +LABEL maintainer="ownCloud GmbH " \ + org.opencontainers.image.authors="ownCloud DevOps " \ + org.opencontainers.image.title="ownCloud PHP" \ + org.opencontainers.image.url="https://hub.docker.com/r/owncloud/php" \ + org.opencontainers.image.source="https://github.com/owncloud-docker/php" \ + org.opencontainers.image.documentation="https://github.com/owncloud-docker/php" + +EXPOSE 8080 + +ENTRYPOINT ["/usr/bin/entrypoint"] +CMD ["/usr/bin/server"] + +RUN apt-get update -y && \ + apt-get install -y \ + apache2 \ + libapache2-mod-php \ + php-gd \ + php-json \ + php-mysql \ + php-sqlite3 \ + php-pgsql \ + php-curl \ + php-intl \ + php-imagick \ + php-zip \ + php-xml \ + php-mbstring \ + php-soap \ + php-ldap \ + php-apcu \ + php-redis \ + php-dev libsmbclient-dev \ + php-gmp \ + smbclient \ + patch \ + mysql-client \ + postgresql-client \ + sqlite && \ + apt-get clean && \ + pecl install smbclient-stable && \ + echo 'extension=smbclient.so' > /etc/php/7.4/mods-available/smbclient.ini && \ + phpenmod smbclient && \ + rm -rf /var/lib/apt/lists/* /etc/apache2/envvars /etc/apache2/conf-* /etc/apache2/sites-* /var/log/apache2/* && \ + a2enmod rewrite headers env dir mime expires remoteip && \ + mkdir -p /var/www/html && \ + chown -R www-data:www-data /var/www/html /var/log/apache2 /var/run/apache2 && \ + chsh -s /bin/bash www-data && \ + curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin --filename=composer && \ + apt-get purge -y php-dev libsmbclient-dev && \ + apt-get -y --purge autoremove && \ + apt-get clean + +COPY ./overlay / +WORKDIR /var/www/html diff --git a/v22.04/manifest.tmpl b/v22.04/manifest.tmpl new file mode 100644 index 0000000..9fccb89 --- /dev/null +++ b/v22.04/manifest.tmpl @@ -0,0 +1,18 @@ +image: owncloud/php:22.04 +tags: + - focal +manifests: + - image: owncloud/php:22.04-amd64 + platform: + architecture: amd64 + os: linux + - image: owncloud/php:22.04-arm64v8 + platform: + architecture: arm64 + variant: v8 + os: linux + - image: owncloud/php:22.04-arm32v7 + platform: + architecture: arm + variant: v7 + os: linux diff --git a/v22.04/overlay/etc/apache2/apache2.conf b/v22.04/overlay/etc/apache2/apache2.conf new file mode 100644 index 0000000..81b90f6 --- /dev/null +++ b/v22.04/overlay/etc/apache2/apache2.conf @@ -0,0 +1,51 @@ +ServerRoot "/etc/apache2" + +Mutex file:${APACHE_LOCK_DIR} default +DefaultRuntimeDir ${APACHE_RUN_DIR} +PidFile ${APACHE_PID_FILE} +Timeout ${APACHE_TIMEOUT} +KeepAlive ${APACHE_KEEP_ALIVE} +MaxKeepAliveRequests ${APACHE_MAX_KEEP_ALIVE_REQUESTS} +KeepAliveTimeout ${APACHE_KEEP_ALIVE_TIMEOUT} + +User ${APACHE_RUN_USER} +Group ${APACHE_RUN_GROUP} + +HostnameLookups ${APACHE_HOSTNAME_LOOKUPS} +AccessFileName ${APACHE_ACCESS_FILE_NAME} + +ErrorLog ${APACHE_ERROR_LOG} +LogLevel ${APACHE_LOG_LEVEL} + +LogFormat "%a %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined +LogFormat "%a %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\" \"%{X-Request-ID}i\"" requestid +LogFormat "%a %l %u %t \"%r\" %>s %O" common + +IncludeOptional mods-enabled/*.load +IncludeOptional mods-enabled/*.conf + +Include ports.conf + + + Options FollowSymLinks + AllowOverride None + Require all denied + + + + AllowOverride None + Require all granted + + + + Options Indexes FollowSymLinks + AllowOverride None + Require all granted + + + + Require all denied + + +IncludeOptional conf-enabled/*.conf +IncludeOptional sites-enabled/*.conf diff --git a/v22.04/overlay/etc/apache2/conf-enabled/charset.conf b/v22.04/overlay/etc/apache2/conf-enabled/charset.conf new file mode 100644 index 0000000..7d0dfbc --- /dev/null +++ b/v22.04/overlay/etc/apache2/conf-enabled/charset.conf @@ -0,0 +1 @@ +AddDefaultCharset ${APACHE_ADD_DEFAULT_CHARSET} diff --git a/v22.04/overlay/etc/apache2/conf-enabled/remoteip.conf b/v22.04/overlay/etc/apache2/conf-enabled/remoteip.conf new file mode 100644 index 0000000..b60f2a7 --- /dev/null +++ b/v22.04/overlay/etc/apache2/conf-enabled/remoteip.conf @@ -0,0 +1 @@ +RemoteIPHeader X-Forwarded-For diff --git a/v22.04/overlay/etc/apache2/conf-enabled/security.conf b/v22.04/overlay/etc/apache2/conf-enabled/security.conf new file mode 100644 index 0000000..3e5b331 --- /dev/null +++ b/v22.04/overlay/etc/apache2/conf-enabled/security.conf @@ -0,0 +1,3 @@ +ServerTokens ${APACHE_SERVER_TOKENS} +ServerSignature ${APACHE_SERVER_SIGNATURE} +TraceEnable ${APACHE_TRACE_ENABLE} diff --git a/v22.04/overlay/etc/apache2/conf-enabled/servername.conf b/v22.04/overlay/etc/apache2/conf-enabled/servername.conf new file mode 100644 index 0000000..dee4bcc --- /dev/null +++ b/v22.04/overlay/etc/apache2/conf-enabled/servername.conf @@ -0,0 +1 @@ +ServerName ${APACHE_SERVER_NAME} diff --git a/v22.04/overlay/etc/apache2/ports.conf b/v22.04/overlay/etc/apache2/ports.conf new file mode 100644 index 0000000..9477d45 --- /dev/null +++ b/v22.04/overlay/etc/apache2/ports.conf @@ -0,0 +1 @@ +Listen ${APACHE_LISTEN} diff --git a/v22.04/overlay/etc/apache2/sites-enabled/default.conf b/v22.04/overlay/etc/apache2/sites-enabled/default.conf new file mode 100644 index 0000000..cfafbef --- /dev/null +++ b/v22.04/overlay/etc/apache2/sites-enabled/default.conf @@ -0,0 +1,13 @@ + + ServerAdmin ${APACHE_SERVER_ADMIN} + + DocumentRoot ${APACHE_DOCUMENT_ROOT} + + ErrorLog ${APACHE_ERROR_LOG} + CustomLog ${APACHE_ACCESS_LOG} ${APACHE_LOG_FORMAT} + + + AllowOverride All + Options +Indexes +FollowSymlinks + + diff --git a/v22.04/overlay/etc/entrypoint.d/99-apache.sh b/v22.04/overlay/etc/entrypoint.d/99-apache.sh new file mode 100755 index 0000000..08e6924 --- /dev/null +++ b/v22.04/overlay/etc/entrypoint.d/99-apache.sh @@ -0,0 +1,81 @@ +#!/usr/bin/env bash + +declare -x HOME +[[ -z "${HOME}" ]] && HOME="/var/www/html" + +declare -x LANG +[[ -z "${LANG}" ]] && LANG="C" + +declare -x APACHE_RUN_USER +[[ -z "${APACHE_RUN_USER}" ]] && APACHE_RUN_USER="www-data" + +declare -x APACHE_RUN_GROUP +[[ -z "${APACHE_RUN_GROUP}" ]] && APACHE_RUN_GROUP="www-data" + +declare -x APACHE_RUN_DIR +[[ -z "${APACHE_RUN_DIR}" ]] && APACHE_RUN_DIR="/var/run/apache2" + +declare -x APACHE_PID_FILE +[[ -z "${APACHE_PID_FILE}" ]] && APACHE_PID_FILE="${APACHE_RUN_DIR}/apache2.pid" + +declare -x APACHE_LOCK_DIR +[[ -z "${APACHE_LOCK_DIR}" ]] && APACHE_LOCK_DIR="/var/lock/apache2" + +declare -x APACHE_ERROR_LOG +[[ -z "${APACHE_ERROR_LOG}" ]] && APACHE_ERROR_LOG="/dev/stderr" + +declare -x APACHE_ACCESS_LOG +[[ -z "${APACHE_ACCESS_LOG}" ]] && APACHE_ACCESS_LOG="/dev/stdout" + +declare -x APACHE_LOG_FORMAT +[[ -z "${APACHE_LOG_FORMAT}" ]] && APACHE_LOG_FORMAT="combined" + +declare -x APACHE_LOG_LEVEL +[[ -z "${APACHE_LOG_LEVEL}" ]] && APACHE_LOG_LEVEL="warn" + +declare -x APACHE_DOCUMENT_ROOT +[[ -z "${APACHE_DOCUMENT_ROOT}" ]] && APACHE_DOCUMENT_ROOT="/var/www/html" + +declare -x APACHE_SERVER_NAME +[[ -z "${APACHE_SERVER_NAME}" ]] && APACHE_SERVER_NAME="localhost" + +declare -x APACHE_SERVER_ADMIN +[[ -z "${APACHE_SERVER_ADMIN}" ]] && APACHE_SERVER_ADMIN="webmaster@localhost" + +declare -x APACHE_SERVER_TOKENS +[[ -z "${APACHE_SERVER_TOKENS}" ]] && APACHE_SERVER_TOKENS="Prod" + +declare -x APACHE_SERVER_SIGNATURE +[[ -z "${APACHE_SERVER_SIGNATURE}" ]] && APACHE_SERVER_SIGNATURE="Off" + +declare -x APACHE_TRACE_ENABLE +[[ -z "${APACHE_TRACE_ENABLE}" ]] && APACHE_TRACE_ENABLE="Off" + +declare -x APACHE_TIMEOUT +[[ -z "${APACHE_TIMEOUT}" ]] && APACHE_TIMEOUT="300" + +declare -x APACHE_KEEP_ALIVE +[[ -z "${APACHE_KEEP_ALIVE}" ]] && APACHE_KEEP_ALIVE="On" + +declare -x APACHE_MAX_KEEP_ALIVE_REQUESTS +[[ -z "${APACHE_MAX_KEEP_ALIVE_REQUESTS}" ]] && APACHE_MAX_KEEP_ALIVE_REQUESTS="100" + +declare -x APACHE_KEEP_ALIVE_TIMEOUT +[[ -z "${APACHE_KEEP_ALIVE_TIMEOUT}" ]] && APACHE_KEEP_ALIVE_TIMEOUT="5" + +declare -x APACHE_ADD_DEFAULT_CHARSET +[[ -z "${APACHE_ADD_DEFAULT_CHARSET}" ]] && APACHE_ADD_DEFAULT_CHARSET="UTF-8" + +declare -x APACHE_HOSTNAME_LOOKUPS +[[ -z "${APACHE_HOSTNAME_LOOKUPS}" ]] && APACHE_HOSTNAME_LOOKUPS="Off" + +declare -x APACHE_ACCESS_FILE_NAME +[[ -z "${APACHE_ACCESS_FILE_NAME}" ]] && APACHE_ACCESS_FILE_NAME=".htaccess" + +declare -x APACHE_LISTEN +[[ -z "${APACHE_LISTEN}" ]] && APACHE_LISTEN="8080" + +declare -x APACHE_ENTRYPOINT_INITIALIZED +[[ -z "${APACHE_ENTRYPOINT_INITIALIZED}" ]] && APACHE_ENTRYPOINT_INITIALIZED="true" + +true diff --git a/v22.04/overlay/usr/bin/entrypoint b/v22.04/overlay/usr/bin/entrypoint new file mode 100755 index 0000000..3e195f7 --- /dev/null +++ b/v22.04/overlay/usr/bin/entrypoint @@ -0,0 +1,10 @@ +#!/usr/bin/env bash +set -eo pipefail +[[ "${DEBUG}" == "true" ]] && set -x + +for FILE in $(find /etc/entrypoint.d -iname \*.sh | sort) +do + source ${FILE} +done + +exec $@ diff --git a/v22.04/overlay/usr/bin/healthcheck b/v22.04/overlay/usr/bin/healthcheck new file mode 100755 index 0000000..4b582e3 --- /dev/null +++ b/v22.04/overlay/usr/bin/healthcheck @@ -0,0 +1,20 @@ +#!/usr/bin/env bash +set -eo pipefail +[[ "${DEBUG}" == "true" ]] && set -x + +if [[ -z "${APACHE_ENTRYPOINT_INITIALIZED}" ]] +then + for FILE in $(find /etc/entrypoint.d -iname \*.sh | sort) + do + source ${FILE} + done +fi + +CHECK="$(curl -sL -w %{http_code} -o /dev/null http://localhost:${APACHE_LISTEN:-8080}/)" + +if [[ "${CHECK}" == "200" ]] +then + exit 0 +fi + +exit 1 diff --git a/v22.04/overlay/usr/bin/server b/v22.04/overlay/usr/bin/server new file mode 100755 index 0000000..250c404 --- /dev/null +++ b/v22.04/overlay/usr/bin/server @@ -0,0 +1,13 @@ +#!/usr/bin/env bash +set -eo pipefail +[[ "${DEBUG}" == "true" ]] && set -x + +if [[ -z "${APACHE_ENTRYPOINT_INITIALIZED}" ]] +then + for FILE in $(find /etc/entrypoint.d -iname \*.sh | sort) + do + source ${FILE} + done +fi + +exec apachectl -f /etc/apache2/apache2.conf -DFOREGROUND diff --git a/v22.04/overlay/var/www/html/index.html b/v22.04/overlay/var/www/html/index.html new file mode 100644 index 0000000..e69de29