You are not logged in.

#1 2016-01-23 12:38:24

orcane
Member
Registered: 2011-04-15
Posts: 21

[SOLVED] Virtualbox with docker and nginx not reachable from host

Hi!
I think I have a rather easy problem, but I can't get it solved.

I have an Ubuntu host running Virtualbox with archlinux in a bridged network. I can ssh from my host into the virtual machine as it has got an IP address from my router.

I installed docker and started an nginx container. When I do a wget from the virtual machine to the container it works.

My goal is to reach the webserver from my host browser, but I can't get it solved.

I tried to add the following iptables rule within the virtual machine, but I still can't connect from my host browser into the docker container.

(sudo iptables -t nat -A PREROUTING -i enp0s3 -p tcp --dport 80 -j DNAT --to 172.17.0.2:80)

Any suggestions? Thanks!

Last edited by orcane (2016-01-23 14:05:37)

Offline

#2 2016-01-23 14:05:03

orcane
Member
Registered: 2011-04-15
Posts: 21

Re: [SOLVED] Virtualbox with docker and nginx not reachable from host

Solved, I needed to explicitly also use the public parameter -p with the port mapping. I had the declaration in the Dockerfile and the docker-compose.yml.

Offline

Board footer

Powered by FluxBB