TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

LXC vs. Docker

217 pointsby lycopodiopsidaover 3 years ago

25 comments

buybackoffover 3 years ago
LXC via Proxmox is great for stateful deployments on baremetal servers. It&#x27;s very easy to backup entire containers with the state (SQLite, Postgres dir) to e.g. NAS (and with TrueNAS then to S3&#x2F;B2). Best used with ZFS raid, with quotas and lazy space allocation backups are small or capped.<p>Nothing stops one from running Docker inside LXC. For development I usually just make a dedicated priviledged LXC container with nesting enabled to avoid some known issues and painful config. LXC containers could be on a private network and a reverse proxy on the host could map to the only required ports, without thinking what ports Docker or oneself could have accidentally made public.
评论 #30391675 未加载
评论 #30388489 未加载
评论 #30389625 未加载
评论 #30388930 未加载
评论 #30394507 未加载
dottedmagover 3 years ago
Apples to oranges.<p>LXC can be directly compared with a small, and quite insignificant, part of Docker: container runtime. Docker became popular not because it can run containers, many tools before Docker could do that (LXC included).<p>Docker became popular because it allows one to build, publish and then consume containers.
评论 #30390192 未加载
评论 #30389227 未加载
评论 #30387634 未加载
评论 #30389814 未加载
评论 #30388027 未加载
评论 #30390644 未加载
评论 #30388898 未加载
评论 #30389988 未加载
unixheroover 3 years ago
LXC has been so stable and great to work with for many years. I have had services in production on LXC containers and it has been a joy. I can not say the same about things I have tried to maintain in production with Docker, in which I had similar experiences to [0], albeit around that time and therefore arguably not recently.<p>For a fantastic way to work with LXC containers I recommend the free and open Debian based hypervisor distribution Proxmox [1].<p>[0], <a href="https:&#x2F;&#x2F;thehftguy.com&#x2F;2016&#x2F;11&#x2F;01&#x2F;docker-in-production-an-history-of-failure&#x2F;" rel="nofollow">https:&#x2F;&#x2F;thehftguy.com&#x2F;2016&#x2F;11&#x2F;01&#x2F;docker-in-production-an-his...</a><p>[1], <a href="https:&#x2F;&#x2F;www.proxmox.com&#x2F;en&#x2F;proxmox-ve" rel="nofollow">https:&#x2F;&#x2F;www.proxmox.com&#x2F;en&#x2F;proxmox-ve</a>
yokem55over 3 years ago
LXD (Canonical&#x27;s daemon&#x2F;API front end to lxc containers) is great -- as long as you aren&#x27;t using the god awful snap package they insist on. The snap is probably fine for single dev machines, but it has zero place in anything production. This is because canonical insists on auto-updating and refreshing the snap at random intervals, even when you pin to a specific version channel. Three times I had to manually recover a cluster of lxd systems that broke during a snap refresh because the cluster couldn&#x27;t cope with the snaps all refreshing at once.<p>Going forward we built and installed lxd from source.
评论 #30389798 未加载
评论 #30390105 未加载
评论 #30391049 未加载
评论 #30391421 未加载
评论 #30390112 未加载
评论 #30390689 未加载
评论 #30390906 未加载
评论 #30390077 未加载
评论 #30391470 未加载
评论 #30454108 未加载
评论 #30391876 未加载
评论 #30391960 未加载
评论 #30394478 未加载
评论 #30390074 未加载
lasftewover 3 years ago
My home server runs Nixos, which is an amazing server operating system: every service is configured in code and fully versioned. I also use this server for development (via SSH), but while Nixos can be used for development, it&#x27;s relationship with VS Code, its plugins, and many native build tools (Golang, Rust) is very complicated, and I prefer not to do everything the Nix way, which is usually convoluted and poorly documented.<p>LXD is my perfect fit in this scenario: trivial to install on top of Nixos, and once running, allows for launching some minimal development instances of whatever distro flavor of the day in a few seconds. Persistent like a small VM, but booting up within seconds, much more efficient on resources (memory in particular), and - unlike docker - with the full power of systemd and all. Add tailscale and sshd to the mix, for easy, secure and direct remote access to the virtualized system.
adamgordonbellover 3 years ago
I like the docker way of one thing, one process, per container. LXC seems a bit different.<p>However, an exciting thing to me is the Cambrian explosion of alternatives to docker: podman, nerdctl, even lima for creating a linux vm and using containerd on macos looks interesting.
评论 #30388062 未加载
评论 #30387394 未加载
评论 #30391737 未加载
istoicaover 3 years ago
The perfect pair<p><i>Containerfile</i> vs <i>Dockerfile</i> - Infra as code<p><i>podman</i> vs <i>docker</i> - <a href="https:&#x2F;&#x2F;podman.io" rel="nofollow">https:&#x2F;&#x2F;podman.io</a><p><i>podman desktop companion</i> (author here) vs <i>docker desktop ui</i> - <a href="https:&#x2F;&#x2F;iongion.github.io&#x2F;podman-desktop-companion" rel="nofollow">https:&#x2F;&#x2F;iongion.github.io&#x2F;podman-desktop-companion</a><p><i>podman-compose</i> vs <i>docker-compose</i> = there should be no vs here, <i>docker-compose</i> itself can use podman socket for connection OOB as APIs are compatible, but an alternative worth exploring nevertheless.<p>Things are improving at a very fast pace, the aim is to go way beyond parity, give it a chance, you might enjoy it. There is continuous active work that is enabling real choice and choice is always good, pushing everyone up.
评论 #30390141 未加载
评论 #30389300 未加载
melenaboijaover 3 years ago
I use LXC containers as my development environments.<p>When I changed my setup from expensive Mac Books to an expensive work station with a cheap laptop as front end to work remotely this was the best configuration I found.<p>It took me few hours to have everything running but I love it now. New project is creating a new container add a rule to iptables and I have it ready in few seconds.
评论 #30387663 未加载
bamboozledover 3 years ago
One major limitation of LXC is that there is no way to easily self host images. Often the the official images for many distributions are buggy. For example, the official Ubuntu images seem to come with a raft of known issues.<p>Based on my limited interactions with it, I&#x27;d recommend staying away from LXC unless absolutely neccesary.
评论 #30389388 未加载
评论 #30387398 未加载
评论 #30387396 未加载
评论 #30388624 未加载
fuzzy2over 3 years ago
I’ve been using LXC as a lightweight “virtualization” platform for over 5 years now, with great success. It allows me to take existing installations of entire operating systems and put them in containers. Awesome stuff. On my home server, I have a VNC terminal server LXC container that is separate from the host system.<p>Combined with ipvlan I can flexibly assign my dedicated server’s IP addresses to containers as required (MAC addresses were locked for a long time). Like, the real IP addresses. No 1:1 NAT. Super useful also for deploying Jitsi and the like.<p>I still use Docker for things that come packaged as Docker images.
评论 #30390534 未加载
sickygnarover 3 years ago
I never hear systemd-nspawn mentioned in these discussions. It ships and integrates with systemd and has a decent interface with machinectl. Does anyone use it?
评论 #30389786 未加载
评论 #30391122 未加载
评论 #30395050 未加载
password4321over 3 years ago
Is it accurate to say LXC is to Docker as git is to GitHub, or vim&#x2F;emacs vs. Visual Studio Code?<p>I haven&#x27;t seen many examples demonstrating the tooling used to manage LXC containers, but I haven&#x27;t looked for it either. Docker is everywhere.
评论 #30388988 未加载
评论 #30388086 未加载
评论 #30388236 未加载
ricmmover 3 years ago
LXC and Docker comparisons vastly differ depending on the use case and problem segment. I use LXC as a tiny, C-only library to abstract namespaces and cgroups for embedded usage [1]<p>LXC is a fantastic userland library to easily consume kernel features for containerization without all the noise around it… but the push for the LXD scaffolding around it missed the mark. It should’ve just been a great library and that’s how we use it when running containers on embedded Linux equipment<p>[1] <a href="https:&#x2F;&#x2F;pantacor.com&#x2F;blog&#x2F;lxc-vs-docker-what-do-you-need-for-iot&#x2F;" rel="nofollow">https:&#x2F;&#x2F;pantacor.com&#x2F;blog&#x2F;lxc-vs-docker-what-do-you-need-for...</a>
micwover 3 years ago
A while ago, I spent some time to make LXC run in a docker container. The idea is to have a statefull system managed by LXC run in a docker environment so that management (e.g. Volumes, Ingress and Load Balancer) from K8S can be used for the LXC containers. I still run a few desktops which are accessible by x2go with it on my kubernetes instances.<p><a href="https:&#x2F;&#x2F;github.com&#x2F;micw&#x2F;docker-lxc" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;micw&#x2F;docker-lxc</a>
malkiaover 3 years ago
I know very little about both, but I&#x27;m at the mercy everyday with lxc on my chromebook when running crostini (it&#x27;s like a VM in a VM in a VM in a...) :) - works great though, at some perf cost, and less GPU support.<p>And still having troubles running most of the docker images out there (either this, or that won&#x27;t be supported). I guess it makes sense, after all there is always the choice of going with full real linux reinstall, or some other hacky ways.<p>But one thing I was not aware was this: &quot;Docker containers are made to run a single process per container.&quot;
sarussoover 3 years ago
Interesting read, not sure why you compared only these two though.<p>There are a plenty of other solutions and Docker is actually many things.. You can use Docker to run containers using Kata for example, which is a runtime providing full HW virtualisation.<p>I wrote something similar, yet much less in detail on Docker and LXC and more as a bird-eye overview to clarify terminology, here: <a href="https:&#x2F;&#x2F;sarusso.github.io&#x2F;blog_container_engines_runtimes_orchestrators.html" rel="nofollow">https:&#x2F;&#x2F;sarusso.github.io&#x2F;blog_container_engines_runtimes_or...</a>
kristianpaulover 3 years ago
At the end the two are different.. why comparing the in the first place?<p>“ LXC, is a serious contender to virtual machines. So, if you are developing a Linux application or working with servers, and need a real Linux environment, LXC should be your go-to.<p>Docker is a complete solution to distribute applications and is particularly loved by developers. Docker solved the local developer configuration tantrum and became a key component in the CI&#x2F;CD pipeline because it provides isolation between the workload and reproducible environment.”
评论 #30394018 未加载
ruhrharryover 3 years ago
LXC is quite different from Docker. Docker is used most of the time as an containerized package format for servers and as such is comparable to snap or flatpak on the desktop. You don&#x27;t have to know Linux administration to use Docker, that is why it is so successfull.<p>LXC on the other hand is lightweight virtualization and one would have a hard time to use it without basic knowledge of administering Linux.
theteapotover 3 years ago
&gt; Saying that LXC shares the kernel of its host does not convey the whole picture. In fact, LXC containers are using Linux kernel features to create isolated processes and file systems.<p>So what is Docker doing then??
p0dover 3 years ago
I&#x27;ve been running my saas on lxc for years. I love that the container is a folder to be copied. Combined with git to push changes to my app all is golden.<p>I tried docker but stuck with lxc.
Nasreddin_Hodjaover 3 years ago
I had to switch to docker after LXC have been snaped.
n3stormover 3 years ago
Love to hear I am not the only one enjoying LXC rather than Docker
junonover 3 years ago
LXC&#x2F;LXD being the clear winner.
gerhardhaeringover 3 years ago
This would have been an ok article in 2013-2015. Nothing really has changed wrt. these two technologies since.
synergy20over 3 years ago
I think docker grew out of lxc initially(to make lxc easier to use), for now, lxc is light weight but it is not portable, docker can run on all OSes, I think that&#x27;s the key difference: cross-platform apps. LXC remains to be a linux-only thing.
评论 #30388492 未加载