What is docker and why docker?

What is Docker?

Docker is a platform for packaging, deploying and running applications.

Docker applications run in containers that can be used on any system: a developer’s laptop, desktop, VM, Cloud etc.

It packages applications as images that contain everything needed to run them: Code, Runtime environment, Libraries and Configuration.

A running instance of a docker image is called a docker container.

Docker containers don’t run in their own virtual machines, but share a Linux kernel. Compared to virtual machines, containers use less memory and less CPU.

However, a Linux runtime is required for Docker. Implementations on non-Linux platforms such as macOS and Windows 10 use a single Linux virtual machine. The containers share this system.

 

Why Docker Containers?

  • Footprint: 100-1000 containers on one machine
  • Small Disk/CPU requirements as compared to VM’s
  • Portability
  • Supported by all Cloud providers
  • Speed:  Boots in seconds
  • Isolation and encapsulation of application dependencies.
  • Ability to scale efficiently, easily, and in real time.
  • Enhances efficiency via easy reuse of images.

Containerization is increasingly popular because containers are:

  • Flexible: Even the most complex applications can be containerized.
  • Lightweight: Containers leverage and share the host kernel.
  • Interchangeable: You can deploy updates and upgrades on-the-fly.
  • Portable: You can build locally, deploy to the cloud, and run anywhere.
  • Scalable: You can increase and automatically distribute container replicas.
  • Stackable: You can stack services vertically and on-the-fly.

Docker containers are built on top of Docker Engine. Each container operates on common Linux kernel of host machine.

  1. All needs for our App are defined in single tiny text file Dockerfile
  2. A sample of Dockerfile – the following few lines construct the whole environment which is production ready:                           
    FROM ubuntu:16:04
    RUN apt-get install -y redis-server
    EXPOSE 5379
    ENTRYPOINT ["/usr/bin/redis-server"]
  3. Containers contain everything our app needs:
    1. Binaries
    2. Libraries
    3. File system
  4. Containers use the following items from the host:
    1. Networks
    2. Kernel

Docker :

 

Please find below video explaining the above concept.

Leave a Comment

Bitnami