Skip to content

Commit 1a43f59

Browse files
committed
Release 7.5.0 - See CHANGELOG.md
1 parent 6775584 commit 1a43f59

File tree

6 files changed

+50
-39
lines changed

6 files changed

+50
-39
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
## 7.5.0 2023-03-15 <dave at tiredofit dot ca>
2+
3+
### Changed
4+
- Quiet down output when loading defaults (xxx is already loaded! warnings)
5+
- Rework initialization
6+
- Fix a weird opcache issue
7+
8+
19
## 7.4.2 2023-02-21 <radarsymphony@github>
210

311
### Changed

Dockerfile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
ARG DISTRO=alpine
2-
ARG DISTRO_VARIANT=3.17
2+
ARG DISTRO_VARIANT=edge
33

44
FROM docker.io/tiredofit/nginx:${DISTRO}-${DISTRO_VARIANT}
55
LABEL maintainer="Dave Conroy (dave at tiredofit dot ca)"
66

77
ARG PHP_BASE
88

9-
ENV PHP_BASE=${PHP_BASE:-"8.1"} \
9+
ENV PHP_BASE=${PHP_BASE:-"8.2"} \
1010
PHP_ENABLE_APCU=TRUE \
1111
PHP_ENABLE_BCMATH=TRUE \
1212
PHP_ENABLE_BZ2=TRUE \
@@ -813,8 +813,11 @@ RUN case "${PHP_BASE}" in \
813813
#### Disabling any but core extensions - When using this image as a base for other images, you'll want to turn turn them on before running composer with the inverse of phpdisomd (phpenmod) to keep things clean
814814
set +x && \
815815
for module in /etc/php${php_folder}/conf.d/*.ini; do if [ ! -L "${module}" ] ; then if [ "$(echo $(basename $module) | grep -c '^[0-9][0-9].*')" = "0" ] ; then mv "${module}" "$(dirname ${module})/20_$(basename ${module})" ; module="$(dirname ${module})/20_$(basename ${module})"; fi ; if ! grep -w -i -q ";priority" "$module"; then echo ";priority=$(basename $module .ini | cut -d _ -f1)" >> $module ; mv "${module}" /etc/php${php_folder}/mods-available/$(basename ${module} .ini | cut -c 4-).ini; fi; fi; done; \
816+
816817
rm -rf /etc/php${php_folder}/conf.d/* && \
818+
sed -i "s|;priority=00|;priority=10|g" /etc/php${php_folder}/mods-available/opcache.ini && \
817819
php_env_plugins_enabled="$(set | sort | grep PHP_ENABLE_ | grep -i TRUE | cut -d _ -f 3 | cut -d = -f 1 | tr [A-Z] [a-z])" && \
820+
cat /etc/php${php_folder}/mods-available/opcache.ini && \
818821
for module in $php_env_plugins_enabled ; do if [ -f "/etc/php${php_folder}/mods-available/${module}.ini" ] ; then priority=$(cat /etc/php${php_folder}/mods-available/${module}.ini | grep ";priority" | cut -d = -f2) ; ln -sf "/etc/php${php_folder}/mods-available/${module}.ini" /etc/php${php_folder}/conf.d/${priority}-${module}.ini ; fi ; done ; \
819822
if [ "${PHP_BASE:0:1}" != "8" ] ; then priority=$(cat /etc/php${PHP_BASE:0:1}/mods-available/json.ini | grep ";priority" | cut -d = -f2) ; ln -sf "/etc/php${PHP_BASE:0:1}/mods-available/json.ini" /etc/php${PHP_BASE:0:1}/conf.d/${priority}-json.ini ; fi ; \
820823
set -x && \

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ The following directories are used for configuration and can be mapped for persi
165165

166166
#### Base Images used
167167

168-
This image relies on an [Alpine Linux](https://hub.docker.com/r/tiredofit/alpine) or [Debian Linux](https://hub.docker.com/r/tiredofit/debian) base image that relies on an [init system](https://github.com/just-containers/s6-overlay) for added capabilities. Outgoing SMTP capabilities are handlded via `msmtp`. Individual container performance monitoring is performed by [zabbix-agent](https://zabbix.org). Additional tools include: `bash`,`curl`,`less`,`logrotate`, `nano`,`vim`.
168+
This image relies on an [Alpine Linux](https://hub.docker.com/r/tiredofit/alpine) or [Debian Linux](https://hub.docker.com/r/tiredofit/debian) base image that relies on an [init system](https://github.com/just-containers/s6-overlay) for added capabilities. Outgoing SMTP capabilities are handlded via `msmtp`. Individual container performance monitoring is performed by [zabbix-agent](https://zabbix.org). Additional tools include: `bash`,`curl`,`less`,`logrotate`, `nano`.
169169
Be sure to view the following repositories to understand all the customizable options:
170170

171171
| Image | Description |

install/assets/defaults/20-php-fpm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ PHP_OPCACHE_REVALIDATE_FREQ=${PHP_OPCACHE_REVALIDATE_FREQ:-"60"}
3333
PHP_POST_MAX_SIZE=${PHP_POST_MAX_SIZE:-"2G"}
3434
PHP_TIMEOUT=${PHP_TIMEOUT:-"180"}
3535
PHP_UPLOAD_MAX_SIZE=${PHP_UPLOAD_MAX_SIZE:-"2G"}
36-
PHP_VERSION=${PHP_VERSION:-$(php -v | head -n 1 | awk '{print $2}')}
36+
PHP_VERSION=${PHP_VERSION:-$(php -v 2>/dev/null | grep "^PHP " | head -n 1 | awk '{print $2}')}
3737
PHP_WEBROOT=${PHP_WEBROOT:-$NGINX_WEBROOT}
3838

3939
#Xdebug 2

install/assets/functions/20-php-fpm

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ phpfpm_bootstrap() {
1212
php_prefix="/etc/php82/"
1313
;;
1414
* )
15-
php_prefix="/etc/php$(php -v | head -n 1 | awk '{print $2}' | cut -c 1)/"
15+
php_prefix="/etc/php$(php -v 2>/dev/null | grep "^PHP " | head -n 1 | awk '{print $2}' | cut -c 1)/"
1616
;;
1717
esac
1818
;;
1919
"debian" )
20-
php_prefix="/etc/php/$(php -v | head -n 1 | awk '{print $2}' | cut -c 1-3)/"
20+
php_prefix="/etc/php/$(php -v 2>/dev/null | grep "^PHP " | head -n 1 | awk '{print $2}' | cut -c 1-3)/"
2121
;;
2222
esac
2323

@@ -132,26 +132,6 @@ EOF
132132
EOF
133133
fi
134134
fi
135-
136-
if var_false "${PHP_KITCHENSINK}" ; then
137-
php_enable_create_sample_php=${PHP_ENABLE_CREATE_SAMPLE_PHP}
138-
unset PHP_ENABLE_CREATE_SAMPLE_PHP # legacy
139-
php_env_plugins_enabled=$(set -o posix; set | sort | grep PHP_ENABLE_ | grep -i TRUE |sed -e 's/PHP_ENABLE_//g' | sed -e 's/=TRUE//g' | awk -vRS="" -vOFS=', ' '$1=$1' | tr A-Z a-z)
140-
for module in $(echo "${php_env_plugins_enabled}" | tr "," "\n" ) ; do
141-
if [ -f "${php_prefix}"/mods-available/"${module}".ini ]; then
142-
print_debug "Enabling ${module}"
143-
silent php-ext enable "${module}"
144-
php_actual_plugins_enabled="${php_actual_plugins_enabled} ${module}"
145-
else
146-
print_error "Requested enabling ${module} however it doesn't exist!"
147-
fi
148-
done
149-
print_notice "PHP-FPM Preparing to start with the following plugins enabled: ${php_actual_plugins_enabled}"
150-
else
151-
php_enable_create_sample_php=${PHP_ENABLE_CREATE_SAMPLE_PHP}
152-
print_warn "Enabling Kitchen Sink mode and allowing all plugins to be active"
153-
silent php-ext enable all
154-
fi
155135
}
156136

157137
phpfpm_configure_logging() {
@@ -325,6 +305,17 @@ EOF
325305
}
326306

327307
phpfpm_post_init() {
308+
case ${os} in
309+
"alpine" )
310+
cp -R /assets/php-fpm/cli/php.ini "${php_prefix}"/
311+
cp -R /assets/php-fpm/mods-available/* "${php_prefix}"/mods-available/
312+
cp -R /assets/php-fpm/fpm/php-fpm.conf "${php_prefix}"/
313+
;;
314+
"debian" )
315+
cp -R /assets/php-fpm/* "${php_prefix}"
316+
;;
317+
esac
318+
328319
case ${os} in
329320
"alpine" )
330321
### Weird Opcache issue
@@ -340,16 +331,25 @@ phpfpm_post_init() {
340331
;;
341332
esac
342333

343-
case ${os} in
344-
"alpine" )
345-
cp -R /assets/php-fpm/cli/php.ini "${php_prefix}"/
346-
cp -R /assets/php-fpm/mods-available/* "${php_prefix}"/mods-available/
347-
cp -R /assets/php-fpm/fpm/php-fpm.conf "${php_prefix}"/
348-
;;
349-
"debian" )
350-
cp -R /assets/php-fpm/* "${php_prefix}"
351-
;;
352-
esac
334+
if var_false "${PHP_KITCHENSINK}" ; then
335+
php_enable_create_sample_php=${PHP_ENABLE_CREATE_SAMPLE_PHP}
336+
unset PHP_ENABLE_CREATE_SAMPLE_PHP # legacy
337+
php_env_plugins_enabled=$(set -o posix; set | sort | grep PHP_ENABLE_ | grep -i TRUE |sed -e 's/PHP_ENABLE_//g' | sed -e 's/=TRUE//g' | awk -vRS="" -vOFS=', ' '$1=$1' | tr A-Z a-z)
338+
for module in $(echo "${php_env_plugins_enabled}" | tr "," "\n" ) ; do
339+
if [ -f "${php_prefix}"/mods-available/"${module}".ini ]; then
340+
print_debug "Enabling ${module}"
341+
silent php-ext enable "${module}"
342+
php_actual_plugins_enabled="${php_actual_plugins_enabled} ${module}"
343+
else
344+
print_error "Requested enabling ${module} however it doesn't exist!"
345+
fi
346+
done
347+
print_debug "PHP-FPM Preparing to start with the following extensions enabled: ${php_actual_plugins_enabled}"
348+
else
349+
php_enable_create_sample_php=${PHP_ENABLE_CREATE_SAMPLE_PHP}
350+
print_warn "Enabling Kitchen Sink mode and allowing all plugins to be active"
351+
silent php-ext enable all
352+
fi
353353

354354
chmod -R 0755 "${php_prefix}"
355355
chown -R root:"${NGINX_GROUP}" "${php_prefix}"

install/usr/sbin/php-ext

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,16 @@ case ${os} in
1818
php_prefix="/etc/php82/"
1919
;;
2020
* )
21-
php_prefix="/etc/php$(php -v | head -n 1 | awk '{print $2}' | cut -c 1)/"
21+
php_prefix="/etc/php$(php -v 2>/dev/null | grep "^PHP " | head -n 1 | awk '{print $2}' | cut -c 1)/"
2222
;;
2323
esac
2424
;;
2525
"debian" )
26-
php_prefix="/etc/php/$(php -v | head -n 1 | awk '{print $2}' | cut -c 1-3)/"
26+
php_prefix="/etc/php/$(php -v 2>/dev/null | grep "^PHP " | head -n 1 | awk '{print $2}' | cut -c 1-3)/"
2727
;;
2828
esac
2929

30-
if [ "${PHP_ENABLE_OPENSSL,,}" = "true" ] && [ ! -f "${php_prefix}mods-available/openssl.ini" ]; then
30+
if [ "${PHP_ENABLE_OPENSSL,,}" = "true" ] && [ ! -f "${php_prefix}/mods-available/openssl.ini" ]; then
3131
export PHP_ENABLE_OPENSSL=FALSE
3232
fi
3333

0 commit comments

Comments
 (0)