Copying xml config files in CommandBox Docker

I’ve recently set up CommandBox Docker image using ColdFusion 2018 in AWS ECS successfully but am running into one issue.

We are making use of Solr collections and since the CFConfig Module doesn’t support any of the Solr configurations and I haven’t had time to look into extending CFConfig, I am going the route of copying a modified version of the neo-solr.xml file that has settings for my docker containers into the ~/serverHome/WEB-INF/cfusion/lib folder

In the Docker file I have added the line and have the copy of the neo-solr.xml file in a devops folder.

COPY./devops/neo-solr.xml ~/serverHome/WEB-INF/cfusion/lib/

I’ve done very similar things in Docker using straight Lucee setup not on CommandBox where I copy some xml.cfm files into the /opt/lucee folders without issue, but the modified version of the neo-solr.xml file isn’t ever copied over.

I’ve also tried having my docker container run a bash file to copy the file over but then I get an error saying “cp: cannot create regular file ‘/root/serverHome/WEB-INF/cfusion/lib/neo-solr.xml’: No such file or directory” which seems weird because the folder structure seems to be in place.

If I bring up the container, ssh in and copy the file manually, restart CommandBox it’s doing exactly what I want. I just can’t seem to make this happen at the time of the Container being created.

I’ve even tried just copying into ~/serverHome to see if I can at least see the file being copied over. But that isn’t happening either.

Is there something I can try to get past this?


which seems weird because the folder structure seems to be in place.

Can you confirm that? Change the command to list out the contents of the directory and see what that shows.

Ahhhh…you’re right. It doesn’t exist at that point, but I do see the .CommandBox folder in there.

Is there a place I can copy this file where it can get picked up?

It looks like the folder name that gets created under .CommandBox/server is always prefixed with a generated key? Is that going to always change or is there a way to keep that static so I could potentially copy the file into server/server_name/adobe-{version number}/WEB-INF/lib?

If you are using the ortus docker images, the server home should always be overridden to be the same place so you don’t need to guess. That said, you can find the server home with:

server info property=serverHomeDirectory

You should be able to just create the folders as necessary. I’m not sure about alpine, but most distros have a -p flag on mkdir that creates parent dirs as well. When CommandBox deploys the engine it should not overwrite any files already there.

Thanks for the help on this Brad.

Creating the folder structure “mkdir -p /root/serverHome/cfusion/WEB-INF/lib” and copying over the neo-solr.xml file in my Dockerfile worked perfectly.

As you had said, the file is not being overwritten when the engine copies everything over to the server home folder.