169
this post was submitted on 28 Sep 2024
169 points (92.9% liked)
Linux
48129 readers
404 users here now
From Wikipedia, the free encyclopedia
Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).
Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.
Rules
- Posts must be relevant to operating systems running the Linux kernel. GNU/Linux or otherwise.
- No misinformation
- No NSFW content
- No hate speech, bigotry, etc
Related Communities
Community icon by Alpár-Etele Méder, licensed under CC BY 3.0
founded 5 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
I run a different LXC on Proxmox for every service, so it's a bunch. Probably a better way to do it since most of those just run a docker container inside them.
Why mix docker and VMs? Isn't docker sort of like a VM, an application-level VM maybe? (I obviously do not understand Docker well)
Serious answer, I'm not sure why someone would run a VM to run just a container inside the VM, aside from the VM providing volumes (directories) to the VM. That said, VMs are perfectly capable of running containers, and can run multiple containers without issue. For work, our Gitlab instance has runners that are VMs that just run containers.
Fun answer, have you heard of Docker in Docker?
I like to run a hypervisor host as just that, a hypervisor host. The host being stable is important, and also reduce attack surface by only having it as that.
An LXC per service is somewhat overkill. A docker host running on LXC could likely run all the docker containers.
I mentioned above, and not to spam, but there might be a use case that requires a different host distribution. Networking isolation might be another reason why. For 90% of use cases, you’re correct.
I have a real use case! I have a commercial server software that can run on Ubuntu or RHEL compatible distributions. My entire environment is Ubuntu. They also allow the server software to run in a docker container but the container must be running RHEL. Furthermore, their license terms require me to build the docker container myself to accept the EULA and the docker image must be built on RHEL! So I have an LXC container running Rocky Linux that gets docker installed for the purpose of building RHEL (Core is 8) imaged docker containers. It’s a total mess but it works! You must configure nested security because this doesn’t work by default.
Instructions here: https://ubuntu.com/tutorials/how-to-run-docker-inside-lxd-containers#1-overview
LXC is much more light weight than VMs, so it's not as much overhead. I've done it this way in case I need to reboot a container (or something goes wrong with an update) without disrupting the other services
Also keeps it consistent since I have some services that don't run in docker. One service per LXC