A general question about containers technology

Hello,
I’m a student and I want to know something about the current container technology.
Excuse me, I don’t know here is a right place or not.
1- Is it true that containers technology have difference with Virtualization? What is their difference?
2- Is it true that the containers that made with container program must have a same OS that host have? On Linux host you can just have Linux containers.
3- What is the advantages and disadvantages of current containers technology?

I’m thankful if anyone answer me.

Thank you.

Yes, that’s the point of containers, they are kernel level process isolation, so all containers share the same kernel. This means no need for any virtualization extension and the overhead that comes with it, you can run tens of thousands of containers on one system when you could only run maybe hundreds of VMs.

Thank you for your reply but how about questions 2 and 3?
Virtualization is useless!!!
With Docker can the OS limit solved? Have Windows container on Linux or vice versa.

You can run different OSes inside the container than the host, but they still share the same kernel.

This means you can run different linux distributions, but you must still run linux.

In LXC and LXD there are system containers, which is one of the many types of containers. Another type is Docker, which is application containers.

A system container is like a virtual machine, but unlike a virtual machine it does not require hardware features from the CPU to perform the virtualization. In addition, a system container reuses your current running Linux kernel. Hence, you may be running Ubuntu on your host, and system containers for Ubuntu, Centos, AlpineLinux. All container will be running the runtime for the respective Linux distribution, but the kernel is the very same Ubuntu kernel that is running on the host.

System containers in Linux use security features in the Linux kernel to isolate the process tree of a Linux distribution, and make it behave as if it is another system inside your computer.
There are no system containers in Windows or OS/X. When you run LXD on Windows or OS/X, you are using a VM (like Hyper-V or VirtualBox) to run a Linux distribution, and inside there there is an installation of LXD to manage system containers.

The purpose of a system container is to run any Linux distribution, and in there it is up to you to install software and configure. The purpose of an application container is to supply a Dockerfile with instructions on how to setup the application that will be running in the container. Hence, it does not make much sense to run other runtimes in Docker since your goal is to get a specific application up and running.

From an educational standpoint, you can make your own Linux container (system or application) quite easily. See, for example, https://github.com/lizrice/containers-from-scratch which explains how to use cgroups and namespaces.

1 Like

When host OS is linux and container OS is windows then how share same kernel?

Thank you for great help.
Thus Docker is not a container like LXC?
With LXC, both host OS and container OS must be Linux. Am I right?
How about Docker? Can host OS linux and application container a Windows ? Is Docker like Vagrant using a VM program?

Lxc containers must be run on a Linux host (or vm).

Lxd supports running both containers and VMs. LXD VMS can run different oses to the host.

LXD using pre-made linux? You can’t install an OS like VM? Docker hub or Vagrant box!

Any idea?

I dont understand your question.