ImVikash_0_0
ImVikash_0_0

Reputation: 174

OS Container vs Application Container

So, the other day I was reading about OS/System Container vs Application Container here.

There it is mentioned that Docker is an application container and

Any container that runs an OS is a system container.

Now, I am confused because even to run applications in Docker you need to have a base image which could any distro. So, shouldn't this make Docker also an OS Container technology? Could anyone list out the differences between OS vs Application Container technology?

Upvotes: 14

Views: 2231

Answers (2)

Noam Yizraeli
Noam Yizraeli

Reputation: 5394

As @csprabala so helpfully pointed in his linked answered thread:

OS Container (or System containers) and Application Container are both first and foremost containers, and that means they operate in a similar fashion by sharing the kernel and including everything they need in their "container image" respectively.

The difference mainly comes when OS containers will almost exclusively use the guest OS kernel directly using their own kernel API function (described here) like a VM would, but unlike a VM - which usually runs above a hypervisor (like Oracle VirtualBox or VMWare ESXi) and has hard disks represented as .vmdk files, System containers run just like any other container on the host OS as a segregated set of processes.

On the contrary, Application containers that use Docker, cri-o or contained (all linked here) still rely on some sort of underlying container engine to serve as the medium to the guest os and run as regular processes on it (unless of different architecture then emulation is used) and that's why if you'd run docker as a service on a Linux distro and lets say a Java application on top of it and you'd check running processes with top you'd see the java process running directly on the Host OS but of course separated with namespaces, PID trees (or Process Trees) and cgroups.

the implementation has some resemblance but is quite different in usage and low level works.

Upvotes: 1

Antebios
Antebios

Reputation: 1781

It's because the application you container can run on any OS the image is based on. You can run the container on any flavor of Linux if the base image is a Linux container. It get's a little more hazy when talking about containerization on Windows (because of the architect of the Linux vs Windows OS). With a virtual machine you need a wheelbarrow to haul all the stuff you need (Operating System, Kernel libraries, misc libraries, then the application and its libraries). With containers you just need a bucket that you can now easily carry (from a Linux perspective) because you just need a few kernel api libraries and then your application and whatever libraries it needs. There is no need to carry the kitchen sink (ie. the Operating System). So, yes, containers are an Application Container because it contains the application, and the OS container needs to haul the Operating System with it. I hope this analogy helps.

Upvotes: 0

Related Questions