Tech●●●●●Difficulty 3 of 5

Why did shipping software in containers change how it runs?

A program in a container may believe it owns the whole computer, yet it sees only what it has been given.

β–Ά Start the story

Containers changed how software runs because a program can now travel together with everything it needs, and run in the same way anywhere. A container is not a whole imitation computer. It is an isolated slice of one operating system: the allows multiple isolated instances, and a program inside one can only see the container's contents and the devices assigned to it, while a program on an ordinary system sees every resource of the machine.

Before this, organizations ran applications on physical servers with no way to define resource boundaries between them, which caused resource allocation problems. Virtual machines solved that by giving each application a full machine with its own operating system. Containers are similar, but with relaxed isolation, because they share the host's operating system. That makes them lightweight, and it usually means less than full virtualization, since no emulation or intermediate virtual machine is needed.

Virtual machine versus container

Virtual machine

  • A full machine with its own operating system
  • Isolated on virtualized hardware

Container

  • Shares the host operating system
  • Considered lightweight
  • Usually less than full virtualization
  • Cannot host a different

The idea has deep roots. On Unix-like systems it is an advanced version of , a mechanism introduced in Version 7 Unix in 1979 that changes the apparent root folder of a process. Docker, the tool that made containers easy to package and ship, came from Solomon Hykes, who started it as an internal project at dotCloud, a company in France. Docker debuted at PyCon in Santa Clara and was released as open source in March 2013.

Its promise was environmental consistency: a container runs the same on a laptop as it does in the cloud. There is a trade-off, however. Because containers share one , they cannot host a different operating system kernel, and security threats can affect the whole containerized system.

Quiz me

0/3

  1. 1.What is the main way a container differs from a virtual machine?
  2. 2.Which limit applies to a Linux container?
  3. 3.Why did Docker's images make deployment easier?

Recap

Containers share the host's kernel, so they are lighter than virtual machines, but cannot run a different kernel.

πŸ’‘ A trick to remember it Β· A virtual machine is a house with its own foundation; a container is a flat in a shared block, with its own door and walls but the same foundation.

Surprising fact Β· Containers descend from chroot, introduced in Version 7 Unix in 1979.

Sources (5)

No source, no claim. Every fact in this lesson (18 claims) cites at least one of these.

  1. [1]OS-level virtualization Β· Wikipedia
  2. [2]Chroot Β· Wikipedia
  3. [3]Containerization (computing) Β· Wikipedia
  4. [4]Docker (software) Β· Wikipedia
  5. [5]Overview | Kubernetes Β· Kubernetes documentation
More lessons in πŸ’» Tech (3) See all tech lessons β†’

One more light on your map.

Get one lesson like this every day, about the things you love. Free, in two or five minutes.

Get the share card for this lesson β†—