1

I'm starting with docker, just triying to run a Docker container with a web aplication and trying to see it in our local network.

I have installed a fresh Ubuntu 14 LTS in VirtualBox, without any extra services (no GUI, no LAMP, no OpenSSH...), and then installed only Docker:

curl -sSL https://get.docker.com/ | sh

and I have run an Odoo (OpenERP) container (previusly run postgree container)

docker run -d -e POSTGRES_USER=odoo -e POSTGRES_PASSWORD=odoo --name db postgres
docker run -p 127.0.0.1:8069:8069 --name odoo --link db:db -t odoo

Very simple. It looks like it is working. I have not installed browser, but I connected via telnet to 127.0.0.1:8069 and sent GET request. It answered.

Now I need to access the service from outside. How?

  • VirtualBox network interface is configured as bridge.

  • I have set a fixed IP (192.168.0.150) in Ubuntu eth0 interface.

  • UFW is disabled

  • I can ping to 192.168.0.150 form other computers, and ubuntu answers.

  • But browser doesnt detect anything at 192.168.0.150:8069

  • Can't connect via telnet to 192.168.0.150:8069

I suppose it must be some configuration of port redirection or interface mapping. Could you help me, please? :)

3

Finally I found the answer. Problem was the port assignement. If you set:

-p 127.0.0.1:8069:8069

you are exposing ONLY localhost. This is great security option if you need only a local service, and want to access it only from the server. But, if you want to expose the port to ALL interfaces, just type:

-p 8069:8069

Then, you can access the service through the network via eth0 interface :)

  • After finding this answer and accodring to oddoargentina the correct command to be able to access container from the outside world is sudo docker run -d --link aeroo_docs:aeroo -p 8069:8069 -p 8072:8072 -v /odoo80/config:/etc/odoo -v /odoo80/sources:/mnt/extra-addons -v /odoo80/data_dir:/var/lib/odoo --link db-odoo80:db --restart=always --name odoo80 adhoc/odoo-adhoc:8.0 – razor7 Aug 4 '16 at 21:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.