0

I have a linux container based on latest ruby image hosted in my windows laptop. I have a sample website running in the container. I can confirm that the website is running fine because running curl http://localhost:4000 with in the container returns the expected html. However, when I try to access the url from a browser in Windows it fails saying that it is not reachable. I am trying to figure out a way to access the sample app using browser in Windows.

Though I am trying to setup a ruby container (as I am trying to learn ruby), I am suspecting this is a networking problem with LCOW because I cannot ping the ip address of the container from Windows command prompt. It gives the error that "TTL expired in transit". Has anyone ever successfully tried a linux container on windows and accessing the website hosted in the container from windows? Could you please help me in figuring out what I am doing wrong or if I have to do something extra, like network route configuration, to make this working?

Further Details:

  1. Docker version: 19.03.4

  2. Host: Windows 10 Business Edition

  3. Base Image: ruby on linux

  4. docker run command used:

    docker run -dit -p 4000:4000 --rm --name test updatedRubyImage

  5. updatedRubyImage: This is a new image I created using base image. I installed a few gems on top of the base and commited it as a new image.

Community
  • 1
  • 1
Martin
  • 644
  • 5
  • 11
  • Use host=0.0.0.0 in your web application when you are starting the server. This makes your server listen on all network interfaces in your container not just localhost. – takacsmark Nov 16 '19 at 16:43
  • @Mark Sorry, I am not familiar with Linux or Ruby. Could you please tell me where and how I make this change? – Martin Nov 16 '19 at 21:07

0 Answers0