0

I am a total newb at this and I want to learn. I have a webapp running in a docker container currently on Ubuntu 16.04TLS. I can connect to it over the Internet and it works fine. I want to run an Apache frontend in a separate container and enable SSL. I worked on this for 8 hours today and I know I was close. I had to restore the VM in the end so i could put the webapp back online.

I followed this tutorial https://medium.com/@jmarhee/running-multiple-web-applications-on-a-docker-host-with-apache-85f673f02803 and was successful at being able to connect to Apache (I got the default home page with the install) but was unable to get Apache to proxy for Tomcat. I got a 503 error when I enabled the proxy pass through. I am all about reading if you folks are good with pointing me in the right direction. Since I want to learn, I may come back with more questions. I did read another article http://stackoverflow.com/questions/24319662/from-inside-of-a-docker-container-how-do-i-connect-to-the-localhost-of-the-mach but I did not understand how to apply it to my situation.

TIA for any help you can provide me with.

  • May I know why there is a need to have two Docker containers? – jackeblagare Jun 20 '17 at 07:41
  • Are you using user-defined network or default network? – Janshair Khan Jun 20 '17 at 07:44
  • Default. IP Addresses are 172.17.0.1 docker0 then .2 & .3 for the containers. – Don Mangiarelli Jun 20 '17 at 07:58
  • @jack one is a custom built container by the developer. They suggested it be deployed this way. – Don Mangiarelli Jun 20 '17 at 08:26
  • @DonMangiarelli Did you try defining a name for container 1 and then using link parameter so that container 2 can connect to container 1? Then use http[s]:// in the proxy settings. – jackeblagare Jun 20 '17 at 08:32
  • @jackelbarge Container 1 has a name. Is this what you are talking about https://docs.docker.com/engine/userguide/networking/default_network/dockerlinks/#connect-with-the-linking-system ? – Don Mangiarelli Jun 20 '17 at 14:22
  • Yes @DonMangiarelli – jackeblagare Jun 21 '17 at 03:42
  • Thank you @jackeblagare. I will try that today and see what I get and let you know if I am successful. Appreciate the help. – Don Mangiarelli Jun 21 '17 at 17:18
  • Linking is deprecated but the most straightforward way to do it... @jackeblagare you should propose that as the answer. – Rondo Jun 21 '17 at 17:24
  • @jackeblagare I think I have found the issue. I have two current docker containers Docker-Webapp and Docker-DB. They are running on a network bridge webapp-bridge )not the docker default). When I run docker network ls I can see that there is a docker0 bridge and a webapp bridge. I think in order for the Apache frontend to talk to the Webapp, it needs to use the webapp bridge. So how do I make that happen. I don't see how to fire up a container to use the webapp bridge. – Don Mangiarelli Jun 22 '17 at 03:25
  • I found it here. https://docs.docker.com/engine/userguide/networking/#user-defined-networks I'll let you guys know if I need further help. – Don Mangiarelli Jun 22 '17 at 04:07
  • @jackeblagare you can only use --link on the default docker bridge network so in my case this would not work. --link is not available on custom created networks (which the application I am running uses). I really appreciate you guys stepping up and helping me out. This is going to be huge for us! – Don Mangiarelli Jun 22 '17 at 04:23

0 Answers0