Docker claims that containers built with it are more portable than pure LXC containers. I think I understand that there are some conventions and automation of the LXC configuration like for hostname and network configuration. But is there more than that?

有帮助吗?

解决方案

If you take a LXC container (and its configuration file), it will be portable only if you run it on a host with the same network configuration; i.e. a bridge with the same name, the same network range, the same router address, and the same DNS server.

Moreover, if the container exposes services, you will have to setup network rules (or something similar) to reach those services. With Docker, there is a coherent syntax to express "yup, I want to expose port 8000 of that container" and then "hey, which public port was allocated for that container's port 8000?"

Docker also adapts the LXC configuration file depending on the local capabilities (for instance, an upcoming patch will enable apparmor containment iff it's available).

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top