containers
The big advantages of containers above VM's is you don't need a complete OS underneath each application. The picture beneath shows the difference.

Now for some terms that keep flying around, i put them in order of 'size' :
- cgroups : control groups are the way the kernel groups containers real-estate
- container : a lightweight VM,it reuses the OS and some libs, but is shielded.
- docker : focuses on applications based on containers.
- kubernetes : orchestrates many docker apps into bigger swarms.
In this list i think docker is the level we are most interested in as a developer. But i think i want to see how the lower level blocks work, and are actually not interested in kubernetes
lxc
Lxc is generally seen as somewhere between chroot and a VM.
https://linuxcontainers.org/lxc/getting-started/
Linux containers. On the given page it states that Ubuntu is an ideal way of starting with linux containers. Installation is merely :
| install lxc | |
|---|---|
usage
If using as a non-root user you have to create an unprivileged container. You cannot do everything in one of those (a good thing). To get a feel for it i now just do a very terse commandline session:
| cli | |
|---|---|
However when starting the container i get this error :
No web advise works, so i reverted to doing it as root with a privileged container :
| privileged container | |
|---|---|
You can attach to the container and look around :
The command ls /home says empty, this is a real debian system you have at your hands, but it is not like a VM. For instance lsblk gives all disks of the host system, also /dev/sdf1 is the same disk as in the hypervisor, so that looks more like a chroot.
To wrap up :