I have created two docker networks:
docker network create --driver=bridge --subnet=172.1.0.0/16 --ip-range=172.1.5.0/24 --gateway=172.1.5.254 br1
docker network create --driver=bridge --subnet=172.2.0.0/16 --ip-range=172.2.5.0/24 --gateway=172.2.5.254 br2
I am doing this in order to facilitate easier container interactions within that network (I do not need to expose ports for containers within that subnet).
Now however, I am interested in networking a few services between my two subnets within Docker (perhaps A as 172.1.0.0 and B as 172.2.0.0).
How can I expose a port so that they can connect to each other between the two subnets? Previous to making the docker subnet, I could just use -p 8000:8000 to expose ports when I ran docker images and then have access the required port.
I am using docker version 1.10.1 and docker-machine.
The documentation suggests this is possible but gives no real examples:
Within a user-defined bridge network, linking is not supported. You can expose and publish container ports on containers in this network. This is useful if you want to make a portion of the bridge network available to an outside network.

-p?