- So in this video, I will tell you how containers
and Linux are closely related.
From a Linux point of view,
a container is an isolated process
that runs with restricted resources.
The Linux kernel provides namespaces and cgroups
as a supporting features to do so.
The namespace is for the isolation.
The cgroup is for resource allocation.
Namespaces have evolved from chroot,
a solution that has been used for decades
to run a process with a "fake root" directory.
We have seen chroot in the lesson about troubleshooting
the boot proceeder.
To learn a successful chroot process,
all dependencies that are required by the process
that is running in the chrooted environment
are required in the chrooted directory.
So if you want to learn your web server
as a chroot process, all of the dependencies
need to be present for this web server
in this chroot directory.
From chroot to container is actually a very small step.
Initially, the required dependencies were copied manually
into the chrooted directory.
That's before the days that
we were talking about containers.
Nowadays we have container images.
The container image is really a tarball
that comes with the container.
It's an archive of files
provided in a standardized format.
The standardization for these images is provided
by the Open Containers Initiative, or OCI,
which is a foundation within LinuxFoundation.
And OCI images are based on Docker images.
So let's talk a bit about Docker.
Before Docker, LXC, which is Linux Native Containers,
was a common way to learn containers,
and LXC comes very close to learning scripts
where Tarballs are used in chrooted directories.
That was foundation, the origin of the container.
Now in 2013, Docker started the Container Revolution.
Initially Docker was based on LXC,
but Docker introduced the Docker image format
as well as the Docker registry
which is also known as Docker Hub.
Docker Hub is a public platform
where anyone can get and post container images.
It's a little bit like GitHub,
but specifically for container images
and there's more than 10 million container images
available on Docker Hub right now.
The Docker image format introduced a solution
to build container images in a smart way,
using common images as parent images
to which only modifications needed to be added.
What does that mean?
Well, if you want to run a database application
then you can focus on your own application
and build a container image in which
a standard database image is used,
so you don't have to build everything from scratch.
You can use already existing components
and fetch these from the image registry,
such as Docker Hub, and that really made
working with containers a lot easier.
At its launch, Docker was mainly open source.
Over the years, the company behind Docker
has moved components to a closed source model.
And that created challenges for companies
that are using Docker containers, including a Red Hat.
Because of Red Hat,
which after all is the biggest Linux distribution,
because Red Hat needed a pure open source solution
instead of a semi-proprietary solution,
they introduced podman
with the release of RHEL 8 in 2018.
Podman of course is an open source project
that has been adopted by Red Hat.
As podman and Docker are fully OCI compliant,
replacing Docker with podman is effortless.
You just need to type the command podman instead of Docker.
And if you don't want to do that,
you just type alias docker is podman.
Currently, podman is widely adopted and available
in all main Linux distributions.
Now working with podman has a couple of benefits.
First, podman installation is very easy.
Just use your local package manager to install it.
So sudo apt install podman and you're ready to go.
Podman requires no daemons or elevated privileges.
And podman allows for rootless containers.
In fact, rootless containers are the default
and that means that management of restricted user entities
inside containers is much easier and much more secure.
Podman is also a full open source solution.
And last, there was one thing very smart
that the podman developers have done,
and that is that they created a command line
that is compatible to Docker.
So you just replaced the Docker command with podman
and you are ready to go
and that makes a transition very easy.
In the next video
you'll learn more about container images.