Your Docker container can connect to the outside world, but the outside world cannot connect to the container. To make the ports accessible for external use or with other containers not on the same network, you will have to use the -P (publish all available ports) or -p (publish specific ports) flag.
To connect to a container using plain docker commands, you can use docker exec and docker attach . docker exec is a lot more popular because you can run a new command that allows you to spawn a new shell. You can check processes, files and operate like in your local environment.
That 192.168.99.101 is Docker host’s IP address internal to Computer A. You only need to config port forwarding from defaut
's port 8069 to host machine' port 8069. Then odoo
will be accessible by computer B with computer A's ip address(ex: 10.0.1.22) plus port 8069. Since both computers are within the same network, you shouldn't need to change settings of your router(except firewall settings, if there is any)
10.0.1.22:8069
Port forwarding need to be set in virtulbox settings
When Docker is installed a Virtual Machine (VM) known as "default" is created inside VirtualBox. Within VirtualBox Docker sets a network configuration that allows the host computer (Computer A) to access containers running on "default" via the docker-machine ip. But Computer B cannot access the same containers via the docker-machine ip.
Follow the screen shot. Note: If using an ethernet cable to connect with the LAN choose en0 rather than en1. MAC Address was removed for the screen shot. It should autofill.
For Mac it's easiest to start the "default" VM by clicking on the Docker QuickStart Terminal icon.
After a wait of a minute or two you'll be presented with a splash screen that includes the "default" IP. This is NOT the BN-IP you're looking for.
This is the part that's the key and ground me down for hours. Fortunately good network discovery instructions exist. Run the instructions in the Docker Terminal and an address for "default.YourLANDomain" should turn up. It'll look something like:
default.ripcord.lan (192.168.1.93) at x:x:xx:xx:xx:xx on en1 ifscope [ethernet]
Notice the "default" part of the above address. That's the name of the Docker VM. Handy for human identification purposes.
If the above doesn't work for finding the BN-IP for the "default" VM you may have luck looking at what your router is seeing (see example below). Notice that "jakes-macbook" has a "2" annotation near the device icon. That means there are two clients associated with the icon. 192.168.1.24 is not the BN-IP for the "default" VM. The IP address will switch back and forth (at odd times). The other address, 192.168.1.93, is the BN-IP for the "default" VM.
Fire up the Odoo container then access it with Computer B at BN-IP address 192.168.1.93:8069 (for example). Great SUCCESS! Hopefully....
Use ping to try and figure out if the BN-IP for the "default" VM is active and go from there to make this method work. For a cleaner solution see the method regarding modifying Network Adapter 1. It is a much easier method to implement.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With