Containers

115

In English usage, a container is something that is used to contain (or hold) something. For example, a container of cookies. Once the cookies are in a container, you can move the container from Place to Place B within the house, or to a different house using a car for transportation. You can also have multiple containers of biscuits together.

The concept is similar for containers in the Kubernetes world; only the cookies are your application code, including all the dependencies to run that code. In real world, the concept of containers was borrowed from shipping containers that carry cargo via the sea.

Stuff you wanna know

    1. Containers are stand-alone executable units, decoupled from the infrastructure.
    2. Containers carry everything from code, its own runtime environment, to system tools, environment variables and libraries, to processes and services and networking interfaces – needed to run an application.
    3. A container is a single process running in the host inside.
    4. Like any other process, a process running inside a container runs inside the host’s operating system. (The process is still isolated from other processes.)
    5. Container isolation happens at the Linux kernel level.
    6. Containers share the kernel of the host operating system with other containers.
    7. Containers eliminate the need to write/de-bug code for different server environments.
    8. Containers are light-weight, portable, and fast.
    9. Containerized apps rely on the system’s hardware architecture. An application built on ARM, for example, will not run on x86 machines.
    10. Each container has its own Network namespace.
    11. You cannot change the code of a container that is already running – you need to recreate the container
    12. Containers are repeatable – you get the same behavior from a container wherever you run it.
    13. Kubernetes is an open-source system for automating deployment, scaling, and management of containerized applications.

A container is created using an image – the container runs its own instance of the image, with its own processes, and environment. Looking for container images? You may like Docker Hub. After you create a container with an image, you can add customizations on top of that.

While Docker has become synonymous with containers, the concept of containerization has been around for some time – chroot, jails in FreeBSD, Linux containers or LXC, or Solaris containers, for example.


 

Ref: