##Use network interfaces to allow docker to speak to it's API via containers
###Daemon and host side config
- Add a new network hardware called api0
ip link add api0 type bridge - Bring it up using
ip link set api0 up - Give it an IP Address
ip addr add 192.168.0.1/16 dev api0 - Restart docker daemon on that IP address
docker -d -H 192.168.0.1:4243 -d
###Docker side config lxc containers can have more than one network interface at startup. So we can just add raw lxc configs to make that link between them.
- Use the following docker command to start a container with the second link to the api0 interface
docker -H 192.168.0.1:4243 run -d
-lxc-conf="lxc.network.type=veth"
-lxc-conf="lxc.network.link=api0"
-lxc-conf="lxc.network.flags=up"
-lxc-conf="lxc.network.ipv4=192.168.0.2/16"
-lxc-conf="lxc.network.name=api0"
-p 22 dhrp/sshd /usr/sbin/sshd -D