I need to create some docker containers that must be accessed by other computers at the same network.
Problem is that when I create the container, Docker gets IP addresses valid only within the host machine.
I already took a look at Docker documentation (Networking) but nothing has worked.
If I run ifconfig
on my machine my IP address is 172.21.46.149
. When I go inside the container (Ubuntu) and run ifconfig
the IP address is 172.17.0.2
. I need Docker to get, for example, 172.21.46.150
.
How can I do it?
You have to create a bridge on your host and assign that bridge to the container. This may help you: https://jpetazzo.github.io/2013/10/16/configure-docker-bridge-network/