Introducing Docker

Docker is an open-source engine that automates the deployment of applications into containers. It was written by the team at Docker, Inc (formerly dotCloud Inc, an early player in the Platform-as-a-Service (PAAS) market), and released by them under the Apache 2.0 license. Docker adds an application deployment engine on top of a virtualized container execution environment. It is designed to provide a lightweight and fast environment in which to run your code as well as an efficient workflow to get that code from your laptop to your test environment and then into production. Docker is incredibly simple. Indeed, you can get started with Docker on a minimal host running nothing but a compatible Linux kernel and a Docker binary.

Unlike hypervisor virtualization, where one or more independent machines run virtually on physical hardware via an intermediation layer, containers instead run user space on top of an operating system’s kernel. As a result, container virtualization is often called operating system-level virtualization.

It can generally only run the same or a similar guest operating system as the underlying host. For example, you can run Red Hat Enterprise Linux on an Ubuntu server, but you can’t run Microsoft Windows on top of an Ubuntu server

Characters of Dokcer

1. An easy and lightweight way to model reality

You can Dockerize your application in minutes. Docker relies on a copy-on-write model so that making changes to your application is also incredibly fast: only what you want to change gets changed.

You can then create containers running your applications. Most Docker containers take less than a second to launch.

2. A logical segregation of duties

With Docker, Developers care about their applications running inside containers, and Operations cares about managing the containers.

3. Fast, efficient development life cycle

Docker aims to reduce the cycle time between code being written and code being tested, deployed, and used.

4. Encourages service orientated architecture

Docker recommends that each container run a single application or process. This makes it very easy to distribute, scale, debug and introspect your applications.

Docker components

1. Docker client and server

Docker is a client-server application. The Docker client talks to the Docker server or daemon, which, in turn, does all the work. Docker ships with a command line client binary, docker, as well as a full RESTful API. You can run the Docker daemon and client on the same host or connect your local Docker client to a remote daemon running on another host.

2. Docker images

You can consider images to be the “source code” for your containers.

3. Registries

There are two types of registries: public and private.

4. Containers

containers are launched from images and can contain one or more running processes. You can think about images as the building or packing aspect of Docker and the containers as the running or execution aspect of Docker.

A Docker container is:

  • An image format.
  • A set of standard operations.
  • An execution environment.

Docker borrows the concept of the standard shipping container, used to transport goods globally, as a model for its containers. But instead of shipping goods, Docker containers ship software.

What can you use Docker for?

  • Helping make your local development and build workflow faster, more ef- ficient, and more lightweight. Local developers can build, run, and share Docker containers. Containers can be built in development and promoted to testing environments and, in turn, to production.
  • Running stand-alone services and applications consistently across multiple environments, a concept especially useful in service-oriented architectures and deployments that rely heavily on micro-services.
  • Using Docker to create isolated instances to run tests like, for example, those launched by a Continuous Integration (CI) suite like Jenkins CI.
  • Building and testing complex applications and architectures on a local host prior to deployment into a production environment.
  • Building a multi-user Platform-as-a-Service (PAAS) infrastructure.
  • Providing lightweight stand-alone sandbox environments for developing, testing, and teaching technologies, such as the Unix shell or a programming language.
  • Software as a Service applications; for example, Memcached as a service.
  • Highly performant, hyperscale deployments of hosts.

Docker’s technical components

  • Docker can be run on any x64 host running a modern Linux kernel; we recommend kernel version 3.8 and later.
    A native Linux container format that Docker calls libcontainer, as well as the popular container platform, lxc. The libcontainer format is now the default format.
  • Linux kernel namespaces, which provide isolation for filesystems, processes, and networks.
  • Filesystem isolation: each container is its own root filesystem. • Process isolation: each container runs in its own process environment. • Network isolation: separate virtual interfaces and IP addressing between containers.
  • Resource isolation and grouping: resources like CPU and memory are allo- cated individually to each Docker container using the cgroups, or control groups, kernel feature.
  • Copy-on-write: filesystems are created with copy-on-write, meaning they are layered and fast and require limited disk usage.
  • Logging: STDOUT, STDERR and STDIN from the container are collected, logged, and available for analysis or trouble-shooting.
  • Interactive shell: You can create a pseudo-tty and attach to STDIN to provide an interactive shell to your container.