How to start a XWiki Container with Proxy parameters

Hey xwiki community,

I want to create a docker container for xwiki with a proxy connection. How can I set the proxy in the docker run command that XWiki can connect to the internet through the proxy?
Thanks for your help already!

Kind regards
Dennis

Hello, do you mean setting up a proxy server in front of an XWiki instance, as in https://www.xwiki.org/xwiki/bin/view/Documentation/AdminGuide/Installation/#HHTTPProxy ?

Or do you mean passing -Dhttp.proxyHost= -Dhttp.proxyPort= system parameters to the Servlet container JVM?

If it’s this then xwiki-docker/README.md at master · xwiki/xwiki-docker · GitHub should answer your needs.

If you need some Tomcat config changes, see xwiki-docker/README.md at master · xwiki/xwiki-docker · GitHub

Hope it helps

Hi Vincent,

thank you for your quick answers!
I’ve got what I wanted with this environment parameter:

-e JAVA_OPTS="-Dhttp.proxyHost=<ProxyIP> -Dhttp.proxyPort=<ProxyPort> -Dhttps.proxyHost=<ProxyIP> -Dhttps.proxyPort=<ProxyPort>"

Kind regards
Dennis

It would be very great if these proxy settings could be configured in an other config file than the start.sh of xwiki. Currently with each update the proxy config has to be done again.

This is not really related to XWiki. You need to check your app server’s doc to understand how to configure it. XWiki just runs inside it as a webapp.

That said, I think you could edit /usr/local/tomcat/bin/setenv.sh.

We provide some default values in it as part of the docker image for Tomcat:

Hi Vincent, sorry I wasn’t completely paying attention to this being a docker related thread.
My comment was more about Debian package with XJetty. As the XJetty start sh is overwritten during each update the proxy configuration in that is overwritten each time.