Introduction to Docker


Docker is an open-source software platform to create, deploy, and manage virtualized application containers on a common operating system (OS), with an ecosystem of allied tools.
Docker is a tool that packages, provisions, and runs containers independent of the OS. Container technology is available through the operating system: A container packages the application service or function with all of the libraries, configuration files, dependencies, and other necessary parts to operate. Each container shares the services of one underlying operating system. Docker was created to work on the Linux platform, but has extended to offer greater support for non-Linux operating systems, including Microsoft Windows and Apple OS X. Versions of Docker for Amazon Web Services (AWS) and Microsoft Azure are available.

How is Docker Container different from VMs?

Both VMs & containers can help get most of the available computer hardware and software resources. VM is an emulation to the computer system. It makes it possible to run what appears to be many separate computers on hardware that is actually one computer. VM requires its own OS while all the hardware resources are virtualized. A hypervisor or Virtual Machine Monitor is used to create and run VM’s. It seats between VM & Hardware.
In containers instead of virtualizing the entire computer only the OS is virtualized.
  • Container seats on top of the Host OS. It shares the OS host kernel along with binaries & libraries. Those shared resources are read-only.
  • As containers shared the resources, their size becomes exceptionally light.

Architecture of Docker

  • Docker uses Client-Server Architecture
  • Components

    • Docker Client
    • Docker Daemon
    • Docker Registry

  • Docker Client communicates with Docker Daemon via REST API which does the main task of building, creating & running containers.

Docker Volumes


Why do we require volume?

Data no longer present once the container is stopped/removed. Hence, it becomes difficult for another process to access that data.
Writing into a container’s writable layer requires a storage driver to manage the filesystem, which slows down the performance.

Where we can use volumes?

  • Sharing data among multiple containers.
  • When you want to backup, restore, or migrate data among multiple Docker hosts.