Can't access the dockerized app launched from the command line from outside

后端 未结 1 1530
耶瑟儿~
耶瑟儿~ 2021-01-16 17:17

I have built a Docker image with Ruby and some gems as a starting point for my projects. Its available at: jikkujose/trial. I am trying this out in a Mac, using

1条回答
  •  鱼传尺愫
    2021-01-16 18:18

    Failed to connect to 192.168.99.100 port 32780: Connection refused
    

    That should mean there is no listener, or, since a docker exec curl http://localhost:4567 does work, that the listener does not accept queries from broadcast, only from localhost...

    Your entrypoint and cmd are:

    ENTRYPOINT ["/opt/rubies/ruby-2.2.2/bin/ruby"]
    CMD ["/app/app.rb"]
    

    Check if others mean to launch a sinatra app would work better with a docker environment: for instance "Dockerizing simple Sinatra app using docker and fig" (fig is the old name of docker compose)

    Before that, check if the mapped port is forwarded at the VirtualBox level:

    VBoxManage controlvm boot2docker-vm natpf1 "name,tcp,127.0.0.1,32780,,32780"
    

    0 讨论(0)
提交回复
热议问题