2

I'm trying to run apache in a container and I need to set the tomcat server in a variable since tomcat container runs in a different namespace.

I've set the variable like this but it doesn't work. I've ensured that the variable is present by echoing it in the container and I can ping the host. Documentation says that we can set environment.

I'm not sure why it isn't working...

/etc/httpd/conf.d/workers.properties

worker.ajp13.port=8009
worker.ajp13.host="${TOMCAT_SERVER}"
worker.ajp13.type=ajp13
worker.ajp13.reply_timeout=15000
2

1 Answer 1

2

Figured it out. Had to use parentheses instead of curly braces. Found a example from this site.

worker.ajp12.host=$(TOMCAT_SERVER)
worker.ajp13.type=ajp13
worker.ajp13.reply_timeout=15000

Now I can pass the variable to docker run command like this..

docker run -e TOMCAT_SERVER=tomcat001 --name httpd -p 80:80 -d httpd:0.0.12

1

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .