so i have been trying to run 'cfpm install caching...
# docker-commandbox
c
so i have been trying to run 'cfpm install caching' in a coldfusion commandbox container start up and while others seem to work, and the logs say it installed, it doesnt for some reason
j
In the J2E deployment of ACF ( which is what CommandBox runs ), you have to install it before the server starts up. If you can either add an
onServerInstall
config like so to your
server.json
or just add a
CFPM_INSTALL
environment variable with the packages you want in a delimited list as the value.
Oh. Sorry. I misread. You mean other packages are installing? I don’t think there is a
caching
package for ACF.
c
image.png
if after the server starts, i run cfpm install caching, it installs it and it works
j
Ah. OK. That is weird. It sounds like it could be a bug. Do you have it set in an
onServerInstall
block?
It definitely shows the correct output:
Copy code
# docker run --rm -it ortussolutions/commandbox:adobe2023 box cfpm install caching

run /bin/bash "/usr/local/lib/serverHome/WEB-INF/cfusion/bin/cfpm.sh" install caching 
Downloading the package caching-2023.0.05.330608.jar
Downloading the dependent package commons-logging-1.2.jar
Downloading the dependent package slf4j-api-1.7.12.jar
Downloading the dependent package commons-pool2-2.11.1.jar
Downloading the dependent package spymemcached-2.12.3.jar
Downloading the dependent package json-20220320.jar
Downloading the dependent package jedis-4.3.1.jar
Downloading the dependent package commons-jcs-core-2.1.jar
Downloading the dependent package ehcache-web-2.0.4.jar
caching (2023.0.05.330608) package and its dependencies have been downloaded successfully.
The package  and its dependencies have been downloaded successfully. ColdFusion server is currently not running. The package will be installed automatically once server is up.
c
if i run it in the dockerfile it runs, doesnt retain the text but it doesnt error. same with injecting it into the start script. i've also tried adding a onServerInitialInstall, but ill try changing it to onserverinstall
j
Yes,
onServerInitialInstall
will only run if you are using an image that is not warmed up ( e.g. a base
ortussolutions/commandbox
image ). If you are using
ortussolutions/commandbox:adobe2023
, for example, you will need to use
onServerInstall
c
no such luck 😞
j
Which base image are you using?
c
ortussolutions/commandbox:adobe2021
j
If you start the container with that, stop, and restart does it show as installed then?
c
im running it in ECS fargate so not something i can really do
j
So you don’t see the same behavior locally? Only in ECS?
c
havent really tried, i have volumes set up that i don't have easily locally
i can figure something out though to try
j
That caching package installs a bunch of Java classes so it may be that one of them doesn’t get registered in the class path in time for the package to show as registered. Are you using an image built and published to a registry or running the base image and mounting your code directories in?
c
running some config in a dockerfile and then a few things injected into the server startup script and mounting it against efs
j
OK. The image in a task definition is coming from a registry. You can add the following to your Dockerfile to warmup the server with the cfpm modules installed:
Copy code
RUN $BUILD_DIR/util/warmup-server.sh