Nesting variables in Apache config

I’m building a Docker-based Apache proxy, and I’d like the proxied port to be configurable.

I link the containers with --link ...:proxied, so Docker makes the environment variables PROXIED_PORT_80_TCP_ADDR and PROXIED_PORT_80_TCP_PORT. I used ProxyPass / "http://${PROXIED_PORT_80_TCP_ADDR}:${PROXIED_PORT_80_TCP_PORT}/" to reverse proxy to port 80.

  • Execute mongodb binaries on alpine linux
  • Access NFS files from Docker
  • Iptables to forward remote port to local port for local access
  • Running VirtualBox in Ubuntu in Mac OSX, won't start up
  • MobileFirst Runtime “Disappearing” in Bluemix Container
  • How to run Docker to listen on a specific port to integrate with Jenkins
  • I’d like the port to be configurable from the command line, when I start the container. I pass the variable as -e "PORT=...", and it is usable as ${PORT} in the Apache config.

    I’ve tried to nest the variables, like ${PROXIED_PORT_${PORT}_TCP_ADDR} without success, and also using the Define plugin, but still no luck.

  • Docker can't start MariaDB/MySQL during Docker build
  • Running an Oracle XE Docker image on a Redhat Host
  • Why is the official SQL Server Express container only meant for development and testing?
  • How background a process to docker
  • TCP, UDP and HTTP servers inside docker stop immediately after starting the container?
  • Templating config file with docker
  • Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.