Skip to content
Please or Register to create posts and topics.

Goodby LXC and LXD, Hello Docker and Kubnetes.

I'm finally ditching LXC / LXD in favor of Docker and K8s, but maybe not for the reasons you might be thinking...

LXC is still, in my opinion, the best container technology for Mautic, and also for most of the monolithic projects out there, which in the case of open source marketing and open-martech, it's over 85% of the existing projects.

However, recent changes have occurred in the LXD world, Canonical decided to pull the project from the Linux Foundation that has been developing and maintaining the project for many years and bring it fully in-house.

I do not have first-hand information about how this was done, but given the recent fork and how things have been going lately, I do not have the same level of trust I used to have in Canonical. At the same time, I am uncertain of what the new path for the fork, Incus will look like in a couple of years from now.

Of course there are many others, maybe even more important reasons to use Docker over LXD, however, for me, coming from OpenVZ and Proxmox, it really made no sense to move to Docker, when its father, LXC was better suited for the task at hand.
In reality, LXD, which is, more seasoned and comparable in features to using Docker + Swarm, is a far superior technology when dealing with monolithic applications. That said, Docker and LXC are father and son and both can do exactly the same thing if you configure them for whatever purpose.

LXD can run microservices, can be clustered, can auto-heal if you add a couple of scripts, etc...
Docker can run persistent applications, just like a system container would, if configured for that purpose...
So the main difference is in its spirit and in how youi create the containers, LXC is meant to be a "System container" You launch it, log in, work on its contents...
Docker is meant as an Application (or even process) container, you create Docker containers with code...

So there is no difference? No, there are significant differences:

But the main difference is, LXC containers are meant to be persistent, Docker containers are meant to be ephemeral, and from that unique difference, two entirely different philosophies drive the development of these 2 tools away from each other.

- LXD can now run virtual machines, Docker can not and probably never will.
- You can run Docker in Windows, Mac and others, you can only run LXC on Linux and a few more Linux-y OSs.
- LXD is a system container, you launch it like you would any other OS, you do your thing in it, and it runs your software "forever".
- Docker is a "Thread in a container" it is meant to run for a limited amount of time, die and, most of the time, resurrect somewhere else.

As a result,
- LXC containers are meant to be persistent.
- Docker containers are meant to be ephemeral.

- LXC containers are "launched and used", then saved into an image, which you can make multiple copies of.
- Docker containers are "Created with code", then brought up from its lesser parts (layers).

- Not the full story, but you could say LXC containers are more on the static side, while Docker containers are more on the dynamic side.

- You can, with very few exceptions, accomplish the same with one or the other.

LXC is, as far as I know, the second-oldest container technology, after OpenVZ, it is rich, seasoned very powerful and stable.
Docker is the third generation of container technology, based on the same principles of "dad" and "grandpa", but with a new and fresh view of the world, and with its sight focused on the datacenter and more specifically, the cloud.

The success of Docker impulsed this new idea of refreshing the old "Linux Containers" (LXC), and they did it with a wrapper API, that is LXD, brilliant!

What is LXD?

LXD is to LXC what Swarm is to Docker, it helps manage multiple containers, facilitates networking, helps with clustering, and so on, just as Swarm does not bring the most advanced features that Kubernetes has, LXD also does not help with these, out of the box.

Hence, not because Docker is better, not because LXC is obsolete, I am in the process of moving from LXC to Docker, the switch will be completed about when Mautic 5 is ready for production, a few months from now.

But because of political reasons, it is time to move away from Canonical, Ubuntu and LXD, and while I love the idea and the people behind Incus, to me, Docker is the obvious future-proof choice and the one container technology that, while maybe not as good as LXC for Monolithic apps, is clearly tha path to the future, a future which is clearly made of Microservices, Serverless and Event-driven, yes it might need a few more years, but it is clearly the path of the future, so here we go!!!

What about Kubernetes?
I still believe K8S is a complete waste of time and resources for running Mautic, K8s is meant to run microservices, and Mautic, no matter how much "separation of concerns" you throw down its throat is a rock solid MONOLITH, and K8s will only make it go slower. Prove me wrong!
However, given the choice between Swarm or Kubernetes, I will probably be using more and more of the latter over time...

Additionally, seeing the political, ethical and technical turbulence in Mautic, after it was "left free" from Acquia, I have decided to diversify, meaning chasing other possible income sources, mainly running and servicing other open-martech apps, while most of them are monolithic still, and very few of these are microservice-based, a bunch are native to or moving towards a modular architecture which, while far from being microservice-based, use many modern technologies and paradigms, amongst hem Docker and K8s.

https://www.reddit.com/r/dotnet/comments/1bjaruu/are_modern_monoliths_really_that_dead/