From f448f204e259a1ca758d3d6946c325d6734b460e Mon Sep 17 00:00:00 2001 From: Mukul Sharma Date: Thu, 3 Sep 2026 15:10:50 +0530 Subject: [PATCH] php-Dockerfile: rewrite header comment to avoid literal $ in prose The previous fix (47a60b7) escaped the functional \$PHPIZE_DEPS reference but added an explanatory comment that itself used several bare/example $ characters (${PHPIZE_DEPS}, $PHPIZE_DEPS, $IDENTIFIER, ${IDENTIFIER}, and a bare $ before a comma). SimpleTemplateEngine parses the ENTIRE file as template source, comments included, so any of those threw either MissingPropertyException or a harder 'illegal string body character after dollar sign' parse error depending on what followed the $. Rewrote the comment to explain the rule in prose without using the $ glyph as an illustrative example at all, so future edits to the comment can't reintroduce this. Verified via grep across all five fallback Dockerfiles that the only remaining $ occurrences are the intentional ${version} placeholders plus the one properly-escaped \$PHPIZE_DEPS. --- resources/com/homelab/php-Dockerfile | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/resources/com/homelab/php-Dockerfile b/resources/com/homelab/php-Dockerfile index ac1b79a..12b4221 100644 --- a/resources/com/homelab/php-Dockerfile +++ b/resources/com/homelab/php-Dockerfile @@ -17,14 +17,25 @@ # extensions on Alpine (unlike the Debian image, which had them # preinstalled) — installed as a virtual package and removed again # right after, so the final image doesn't carry build tooling. -# \$PHPIZE_DEPS escaped (not ${PHPIZE_DEPS} or bare $PHPIZE_DEPS) — -# this whole file goes through constructTemplate.groovy's -# SimpleTemplateEngine first, which treats bare $IDENTIFIER the same -# as ${IDENTIFIER} (Groovy GString interpolation syntax) and tried to -# resolve it against the render binding (which only has `version`), -# throwing MissingPropertyException before this ever became a real -# Dockerfile. \$ survives the template pass as a literal $, which is -# what the shell needs to actually expand this at RUN time. +# +# NOTE ON DOLLAR SIGNS IN THIS FILE (read before editing anything +# below, comments included): the whole file — every line, comments +# included — is fed through constructTemplate.groovy's +# SimpleTemplateEngine before it becomes a real Dockerfile. That +# engine treats any dollar-sign character as the start of a Groovy +# interpolation, whether or not a human reading it would call it +# "code". A dollar sign followed by a letter or underscore gets +# looked up in the render binding (only `version` exists there) and +# throws a MissingPropertyException if not found there; a dollar sign +# followed by anything else (punctuation, space, end of line) can't +# even be parsed as an interpolation attempt and throws a harder +# syntax error instead. The only dollar sign meant to reach the shell +# below (in the PHPIZE_DEPS line) is escaped with a leading backslash +# for exactly this reason. Because a stray dollar sign in prose is +# this easy to reintroduce by accident (an earlier revision of this +# very comment did so), new edits to this header should avoid typing +# the character at all — write "dollar sign" in words instead of using +# the glyph. FROM harbor.192.168.1.7.nip.io/base-images/php:${version}-cli-alpine WORKDIR /var/www/html RUN apk add --no-cache --virtual .build-deps \$PHPIZE_DEPS \