LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Containers
User Name
Password
Linux - Containers This forum is for the discussion of all topics relating to Linux containers. Docker, LXC, LXD, runC, containerd, CoreOS, Kubernetes, Mesos, rkt, and all other Linux container platforms are welcome.

Notices


Reply
  Search this Thread
Old 09-11-2023, 05:08 PM   #1
lester29
LQ Newbie
 
Registered: Mar 2023
Posts: 3

Rep: Reputation: 0
Are LXC or Docker containers suitable for VPS?


Hello. I've a newbie questions
  1. Are containers suitable for VPS or for use inside running virtual machine? Do containers have a significant overhead for the running system on VPS or VM?
  2. How secure are applications running in containers compared to services running directly on the host system?
Thanks

Last edited by lester29; 09-11-2023 at 05:14 PM.
 
Old 09-12-2023, 12:43 AM   #2
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,237

Rep: Reputation: 5322Reputation: 5322Reputation: 5322Reputation: 5322Reputation: 5322Reputation: 5322Reputation: 5322Reputation: 5322Reputation: 5322Reputation: 5322Reputation: 5322
Question 1: ZERO overhead, and excellent support for using cgroups to set limits.
 
Old 09-12-2023, 09:22 PM   #3
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,671
Blog Entries: 4

Rep: Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945
There are two entirely different concepts here, and let me try to explain ...

Virtual Machines: "VPS" is simply another packaging of this concept, and "VMWare®" made an industry out of it. At this level of isolation, you are actually able to run "the entire [Linux or Windows] operating system(!)" as though it actually had "an entire physical machine to itself," even though it actually doesn't. Plenty of viable "virtual machine" solutions now exist for any combination of "guest" and "host," and all of them work well.

But: "What do we actually need to provide, in order to safely run your application [in a shared environment]?" Do you in fact need "actual physical [virtual] reality," or merely "the illusion thereof?" . . .

Containers: Implementors quickly realized that many real-world situations actually just required isolation, and they needed to be able to do so "cheaply." Thus, various technologies were developed by which "isolation" could be achieved within "a single machine." (Virtual or not.) The kernel implements the facilities, and "container" technology "ties them up in a neat little package and ties a pretty bow around it." Now, classic "timesharing" techniques could be applied, yet the "container occupants" would never encounter the "timesharing" host. They could "blissfully believe" that they had a machine to themselves, but the underlying host didn't actually have to provide one. The result works, and it is very efficient and scalable.

As I have said: "'Containers' are 'rose-colored glasses.'" They are actually a context that is imposed upon an otherwise-ordinary "running process" on any particular host computer. This context restricts what the process is able to perceive concerning: the filesystem, the network, its user-id, and its "root privileges." (And, so on ...) But, since the whole thing is actually an illusion, it is "extremely cheap." Versus virtual machines.

"Containers" cannot do what "virtual machines" can do. For example: you cannot use them to run "Windows" on "Linux" nor vice-versa. But if what you actually require is isolation, they are an excellent solution.

Key Point: "Virtual Machines" are "[virtual] reality," while "Containers" are "a cleverly-engineered but entirely functional illusion."

- - -

Docker® is a specific packaging of "container technology" that is especially designed for quick deployment of "routine situations." Of which there are a great many. Someone out there writes a Dockerfile and puts all of the messy setup commands into it. You just grab it off the shelf and use it, not caring what exactly it contains. "Okay, I need a 'PHP server' and a 'MySQL server' and a ..." Without concerning yourself directly as to exactly how they work, you simply focus on "plugging them up." This can be both a good thing and a not-so-good thing, depending on your point of view. (The first implementations of Docker actually used lxc/lxd as the base, but they have gone their own way since then.) In the right situations, Docker can save a lot of drudgery. But it's not the only way to do it.

Last edited by sundialsvcs; 09-13-2023 at 08:52 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: The rocky road to better Linux software installation: Containers, containers, containers LXer Syndicated Linux News 0 11-27-2021 10:49 AM
LXer: You are here: Home / Tips / How to Run Docker Containers How to Run Docker Containers LXer Syndicated Linux News 0 01-29-2020 03:00 PM
LXer: Everything You Need to Know about Linux Containers, Part II: Working with Linux Containers (LXC) LXer Syndicated Linux News 0 08-27-2018 01:53 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Containers

All times are GMT -5. The time now is 04:28 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration