From 2335c3151b93ea6a4cf8779c4c90cb21572b6c50 Mon Sep 17 00:00:00 2001 From: William Desportes Date: Tue, 2 Apr 2024 22:20:35 +0200 Subject: [PATCH] Ref #187 - Make custom ini files writable in rootless mode --- Dockerfile-alpine.template | 7 ++++++- Dockerfile-debian.template | 7 ++++++- apache/Dockerfile | 7 ++++++- fpm-alpine/Dockerfile | 7 ++++++- fpm/Dockerfile | 7 ++++++- 5 files changed, 30 insertions(+), 5 deletions(-) diff --git a/Dockerfile-alpine.template b/Dockerfile-alpine.template index f2376397..9393ada0 100644 --- a/Dockerfile-alpine.template +++ b/Dockerfile-alpine.template @@ -68,7 +68,12 @@ RUN set -ex; \ echo 'upload_max_filesize=${UPLOAD_LIMIT}'; \ echo 'date.timezone=${TZ}'; \ echo 'session.save_path=${SESSION_SAVE_PATH}'; \ - } > $PHP_INI_DIR/conf.d/phpmyadmin-misc.ini + } > $PHP_INI_DIR/conf.d/phpmyadmin-misc.ini; \ + \ + { \ + echo ''; \ + } > $PHP_INI_DIR/conf.d/phpmyadmin-hide-php-version.ini; \ + chown www-data:www-data $PHP_INI_DIR/conf.d/phpmyadmin-hide-php-version.ini; # Calculate download URL ENV VERSION %%VERSION%% diff --git a/Dockerfile-debian.template b/Dockerfile-debian.template index 7c757e09..49b436eb 100644 --- a/Dockerfile-debian.template +++ b/Dockerfile-debian.template @@ -79,7 +79,12 @@ RUN set -ex; \ echo 'upload_max_filesize=${UPLOAD_LIMIT}'; \ echo 'date.timezone=${TZ}'; \ echo 'session.save_path=${SESSION_SAVE_PATH}'; \ - } > $PHP_INI_DIR/conf.d/phpmyadmin-misc.ini + } > $PHP_INI_DIR/conf.d/phpmyadmin-misc.ini; \ + \ + { \ + echo ''; \ + } > $PHP_INI_DIR/conf.d/phpmyadmin-hide-php-version.ini; \ + chown www-data:www-data $PHP_INI_DIR/conf.d/phpmyadmin-hide-php-version.ini; # Calculate download URL ENV VERSION %%VERSION%% diff --git a/apache/Dockerfile b/apache/Dockerfile index 2984356b..af95c138 100644 --- a/apache/Dockerfile +++ b/apache/Dockerfile @@ -80,7 +80,12 @@ RUN set -ex; \ echo 'upload_max_filesize=${UPLOAD_LIMIT}'; \ echo 'date.timezone=${TZ}'; \ echo 'session.save_path=${SESSION_SAVE_PATH}'; \ - } > $PHP_INI_DIR/conf.d/phpmyadmin-misc.ini + } > $PHP_INI_DIR/conf.d/phpmyadmin-misc.ini; \ + \ + { \ + echo ''; \ + } > $PHP_INI_DIR/conf.d/phpmyadmin-hide-php-version.ini; \ + chown www-data:www-data $PHP_INI_DIR/conf.d/phpmyadmin-hide-php-version.ini; # Calculate download URL ENV VERSION 5.2.1 diff --git a/fpm-alpine/Dockerfile b/fpm-alpine/Dockerfile index f9479944..9a98124b 100644 --- a/fpm-alpine/Dockerfile +++ b/fpm-alpine/Dockerfile @@ -69,7 +69,12 @@ RUN set -ex; \ echo 'upload_max_filesize=${UPLOAD_LIMIT}'; \ echo 'date.timezone=${TZ}'; \ echo 'session.save_path=${SESSION_SAVE_PATH}'; \ - } > $PHP_INI_DIR/conf.d/phpmyadmin-misc.ini + } > $PHP_INI_DIR/conf.d/phpmyadmin-misc.ini; \ + \ + { \ + echo ''; \ + } > $PHP_INI_DIR/conf.d/phpmyadmin-hide-php-version.ini; \ + chown www-data:www-data $PHP_INI_DIR/conf.d/phpmyadmin-hide-php-version.ini; # Calculate download URL ENV VERSION 5.2.1 diff --git a/fpm/Dockerfile b/fpm/Dockerfile index 4ec338b0..cc6c0657 100644 --- a/fpm/Dockerfile +++ b/fpm/Dockerfile @@ -77,7 +77,12 @@ RUN set -ex; \ echo 'upload_max_filesize=${UPLOAD_LIMIT}'; \ echo 'date.timezone=${TZ}'; \ echo 'session.save_path=${SESSION_SAVE_PATH}'; \ - } > $PHP_INI_DIR/conf.d/phpmyadmin-misc.ini + } > $PHP_INI_DIR/conf.d/phpmyadmin-misc.ini; \ + \ + { \ + echo ''; \ + } > $PHP_INI_DIR/conf.d/phpmyadmin-hide-php-version.ini; \ + chown www-data:www-data $PHP_INI_DIR/conf.d/phpmyadmin-hide-php-version.ini; # Calculate download URL ENV VERSION 5.2.1