Docker Community Forums

Share and learn in the Docker community.

Replacing lxc by docker-compose

Using LXC each container gets its own virtual network interface on the host. I can set the container’s routable IP address/subnet mask, gateway and some other network params easily in the container’s config file, or I can let the container configure its network interface on its own (e.g. via /etc/network/interfaces and ifupdown in Debian). IPv4 and IPv6. If I want to, then the container can even use dhcp to obtain an IPv4 address and DHCP options from the local network the host is connected to. Running an LXC container is like adding a new host to the local network.

Using Docker each container seems to get its own virtual network interface on the host as well, but I am missing the ease-of-use known from LXC. Are there some guidelines how to achieve an easy-to-do network configuration using docker-compose, providing routable IP addresses instead of unroutable, private subnets?

I would like to replace LXC with docker/docker-compose, but this is a major obstacle. Every helpful comment is highly appreciated.