Hi everyone,
We’ve been migrating our Docker builds to use Lucee 7’s native build-time warmup (LUCEE_ENABLE_WARMUP=true) combined with Server.cfc:onBuild() (introduced in LDEV-4922
) to pre-cache Maven dependencies declared in javaSettings / mavenLoad().
We build our own Tomcat container starting from stock Apache Tomcat and downloading lucee-light-7.0.5.41.jar directly. We noticed an interesting lifecycle behavior:
Steps to reproduce:
Fresh container with Tomcat and lucee-light-7.0.5.41.jar in lucee/ (no existing /opt/lucee/server/lucee-server/ state on disk).
Place Server.cfc at /opt/lucee/server/lucee-server/context/context/Server.cfc containing an onBuild() function.
Run Tomcat with LUCEE_ENABLE_WARMUP=true /usr/local/tomcat/bin/catalina.sh run.
Observation:
On the first run, the lucee-light bootstrap loader contacts download.lucee.org, downloads 7.0.5.41.lco, unzips bundles, and terminates. Server.cfc:onBuild() is never invoked.
On a second consecutive run (LUCEE_ENABLE_WARMUP=true catalina.sh run), 7.0.5.41.lco is now already present on disk. The engine starts up, triggers CFMLEngineImpl$OnStart, and Server.cfc:onBuild() executes cleanly.
Why this happens: On a cold filesystem with lucee-light, the loader is responsible for fetching the .lco patch. Because the core engine is not yet present at initial startup, the full CFML engine lifecycle (which initializes PageContext and dispatches onBuild()) does not run on pass 1 before the warmup exit hook shuts down Felix.
Question / Suggestion: For users authoring slim containers with lucee-light.jar, is running a two-pass warmup in the Dockerfile the expected pattern, or should the lucee-light loader chain directly into the core engine startup once .lco extraction finishes during warmup?
Thanks!