Hello,
I am having an issue when running xwiki in a container with the CONTEXT_PATH environment variable set up.
The error is pretty easily reproduced, too.
- Clone the xwiki-docker repo
- Go to
18.4/postgres-tomcat - Edit
docker-compose.ymland add the environment variableCONTEXT_PATHto any value (besides the empty string), for instance“wiki" - run
docker compose up
We get an error by infinispan telling “The ‘org.xwiki.infinispan’ JMX domain is already in use.”, most likely by another xwiki instance!
When going to localhost:8080, I get a 404 error, but on localhost:8080/wiki, the xwiki instance works correctly.
In the logs, we can see these two lines :
04-Aug-2026 14:39:43.774 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/usr/local/tomcat/webapps/wiki] has finished in [21,719] ms
04-Aug-2026 14:39:43.774 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/usr/local/tomcat/webapps/ROOT]
meaning that two xwiki apps are starting. To ensure that we indeed have two xwiki running, I ran :
docker exec -t <container> ls -R /usr/local/tomcat/webapps/ROOT
and
docker exec -t <container> ls -R /usr/local/tomcat/webapps/wiki
I got the same results.
Investigating a little deeper, I noticed that in the file docker-entrypoint.sh, in the beginning of the configuration function, there is the following code:
if [ "$CONTEXT_PATH" == "ROOT" ]; then
xwiki_set_cfg 'xwiki.webapppath' ''
else
mkdir -p -v /usr/local/tomcat/webapps/$CONTEXT_PATH
cp -a --update=none /usr/local/tomcat/webapps/ROOT/. /usr/local/tomcat/webapps/$CONTEXT_PATH/
fi
This code first appears on this commit, and before that, the action was to move the ROOT repository, not copy it. I suppose to fix this issue one would need to create another docker image with the entrypoint file modified as it is copied into the container by the Dockerfile, at build time.
If this behaviour is intended however, I would gladly like to know where I am doing things wrong and how I can fix this issue ![]()
Thank you very much!
error.log (100.5 KB)