LXD: Containers for Human Beings
secluded.site
secluded.site
Yeah, if you run Docker then you should only run one service, but that's not a technical limitation. I have images that have the standalone application, but you can also get them with a bundled database in the image for simplicity.
I can create a basic Debian container, connect and apt install anything I want. I can also snapshot the image using command tools.
So other than emotional arguments that you should run single services in a container from the OCI side, is there actually any difference?
People that work with LXD typically say that LXD is closer to VMs than OCI containers. You can use one image and create a VM as well as a container from it with LXD. This brings things like full-featured kernel load with your process.
If that's the main differentiating factor though, that's deeply unconvincing to me, personally.
https://github.com/opencontainers/runtime-spec/blob/main/con...
- Binding a port to a running container
- systemd/init daemons inside a non-privileged container
There is a lot more I've run into over the years though, despite often being considered peers there's some fairly big architectural differences under the hood.
Stateless (Docker) vs Stateful (LXC).
That's 2 different purposes.
Imagine you need to install an application that will install/persist some files to /etc, some files to /var, some files to /bin... etc. In Docker, you will need to install that application during build time, specify volume path, specify the ENTRYPOINT to the application and use the resulting image to run it. In LXD, you can exec into the container and install it, setup systemd service to run it on startup - exactly like what you would do in a VM.
It's easily fixable but requires customisation as docker doesn't want to support it by default.
So nothing about OCI images is incompatible, but docker specifically yes.
This does a pretty good job at explaining how containers work, but the author seems to equate LXC with LXD, and doesn't even mention LXC once. If I remember correctly the actual container part of Linux containers (doing cgroups/namespaces) is LXC, then LXD is a management daemon frontend on top of that? I think a lot of people do use LXD as their frontend rather than interacting with LXC directly (especially Ubuntu users, since they seem to steer you that way), but if you're going to do a deep dive into containers like this it's a pretty huge omission not to explain the difference. Another really cool security feature of LXC they also could've mentioned was unprivileged/rootless containers.
Personally I had a very hard time with Linux Containers when using LXD and prefer using LXC directly. I can see why it's supposed to be user-friendly but it always reeked of Ubuntu bloat to me.
This is correct. LXD is a set of abstractions on top of LXC intended to make some aspects of working with LXC, like networking, a bit easier.
I did gloss over LXC vs LXD and I agree that it would be good to explain the difference between them. I'll make the edit and mention unprivileged containers when I get back to my PC this evening :)
Another solid move from Canonical. I guess I'll check out Incus then
If only distros provided more package versions than just the tip. I don't mind if they get withdrawn due to massive security issues but if your image requires an installation of a library, you can't pin a version because most distros will remove it after releasing an update.
Dockerfile/Docker-compose deployments fit in a couple of lines, where an Ansible deployments can spread easily across multiple playbooks.
Dockerfile is quite declarative (WORKDIR, USER, COPY, etc). It's easier to predict what it will do than when using a pure bash script or ansible playbook.
And even RUN, by leverage the cache layers, it gives you a bit of immutability + and increased provisioning speed.