Cloud - Concept

Dockers, Containers & Kubernetes.

Vipin Vij

Vipin

What are Containers?

"Docker" and "containers" are often used interchangeably, but it's important to understand the distinction.

Containers are a lightweight form of virtualization that allow you to package an application and its dependencies into a single, isolated unit. Containers provide a consistent and portable runtime environment, enabling the application to run reliably across different systems and environments. Containers virtualize the operating system, allowing multiple containers to run on a single host OS.

Docker, on the other hand, is an open-source platform that simplifies the creation, deployment, and management of containers. It provides a set of tools and APIs that streamline the containerization process. Docker makes it easier to build, package, and distribute containers, as well as manage their lifecycle.

Containers are a form of operating system virtualization. A single container might be used to run anything from a small microservice or software process to a larger application. Inside a container are all the necessary executables, binary code, libraries, and configuration files.



Docker vs containers vs kubernetes

Advantages of Docker containers

Docker containers offer several benefits that have contributed to their widespread adoption in the software development and deployment landscape. Here are some key advantages of using Docker containers:

  • Built once, run again & again:
  • Platform independent. Built it once and run it anywhere.

  • Increased portability:
  • Applications running in containers can be deployed easily to multiple different operating systems and hardware platforms. More consistent operation DevOps teams know applications in containers will run the same, regardless of where they are deployed.

  • Rapid Application Deployment:
  • Docker containers streamline the deployment process and enable faster application delivery. With Docker, you can package the application, its dependencies, and configuration into a single container image. This image can be easily replicated and deployed across different environments, simplifying the deployment process and reducing the potential for configuration errors.

  • Isolation:
  • Docker containers offer a high level of application isolation. Each container operates in its own isolated environment, with its own file system, network interfaces, and process space. This isolation prevents conflicts between applications and reduces the risk of one application impacting others running on the same host.

  • Ecosystem and Community:
  • Docker has a vibrant and active community, which has contributed to a vast ecosystem of pre-built container images, tools, and integrations. This ecosystem provides a wealth of resources, including official and community-supported images for popular software and services, making it easier to adopt and leverage existing solutions.

Docker Image vs Containers

A container is a lightweight, standalone, and executable software package that includes everything needed to run a piece of software, including the code, runtime, system tools, libraries, and settings. Containers provide a consistent environment for applications to run, making them portable and easily deployable across different computing environments. Containers work on the principle of containerization, which allows applications to be isolated from the underlying system and other applications, ensuring that they run consistently across various environments. This isolation is achieved by utilizing containerization technologies that leverage features of the operating system, such as namespaces and cgroups, to create separate containers with their own isolated resources.

Docker, on the other hand, is a specific platform and set of tools for creating, deploying, and managing containers. It played a significant role in popularizing containers and making them widely accessible. Docker uses containerization technologies in conjunction with a high-level API and toolset to simplify the process of working with containers. Some key points about Docker are:

  • Docker Engine:
  • The core component that allows containers to be created and managed on a host system.

  • Dockerfile:
  • A text file that contains instructions for building a Docker image, which is a lightweight, standalone executable package that includes the application and its dependencies.

  • Docker Hub:
  • A registry service provided by Docker that hosts a vast collection of pre-built Docker images that users can pull and use.

  • Docker Compose:
  • A tool for defining and managing multi-container Docker applications, allowing you to define the services, networks, and volumes required for a complete application stack.

  • Docker Swarm (now part of Docker Engine):
  • A native clustering and orchestration solution for Docker, enabling the management of a cluster of Docker nodes.

Summary

In summary, while containers are a general concept referring to isolated software packages, Docker is a specific technology and platform that enables the creation, distribution, and management of containers using a set of tools and services.

What is Kubernetes?

Although Docker offers an efficient method for packaging and distributing containerized applications, effectively running and managing containers on a large scale presents a significant challenge when relying solely on Docker. Addressing tasks such as coordinating and scheduling containers across multiple servers/clusters, seamless deployment and upgrades of applications with zero downtime, and ensuring the health of containers demand careful consideration.

To overcome these obstacles and tackle additional issues, container orchestration solutions like Kubernetes have emerged. Kubernetes provides a framework that enables efficient container management, making it an ideal choice for handling the complexities of large-scale container deployments.

Some other counterpart of Kubernetes are: Docker Swarm, Mesos, HashiCorp Nomad and others.

Kubernetes, often abbreviated as K8s (with "8" representing the eight letters between "K" and "s" in Kubernetes), is an open-source container orchestration platform. It was originally developed by Google and later donated to the Cloud Native Computing Foundation (CNCF). Kubernetes automates the deployment, scaling, and management of containerized applications.

Simply put, Kubernetes is a powerful tool used to manage and control the deployment and operation of applications packaged in containers. As I mentioned earlier, Containers are a lightweight and portable way to package an application along with all its dependencies, ensuring consistency across different environments. However, managing multiple containers across various servers or clusters can become complex. That's where Kubernetes comes in to streamline the process.

Kubernetes offers a set of features and functionalities that enable users to:

  • Automate Deployment:
  • Kubernetes can automatically deploy containerized applications across a cluster of servers, ensuring the desired state is maintained.

  • Scale Applications:
  • Kubernetes can scale applications up or down based on demand, ensuring resources are efficiently utilized.

  • Load Balancing:
  • You may also use Kubernetes to distribute network traffic to ensure stable and reliable application performance.

  • Self-healing:
  • To me this one is super cool 😎. If a container or node fails, Kubernetes automatically reschedules containers to ensure the desired state is maintained.

Here is official documentation: kubernetes

Related blogs

Virtual Machine

A computer system created using software on one physical computer in order to emulate the functionality of another separate physical computer.

Data Center

A large group of networked computer servers typically used by organizations for the remote storage, processing, or distribution of large amounts of data.

Virtualisation

Virtualization is a process that allows for more efficient utilization of physical computer hardware and is the foundation of cloud computing.

Explore more

What is Cloud?

Understand the What and Why behind cloud technologies.

Hypervisor

Critical concept that made virtual machines possible.

Cloud deployment models

Public Cloud vs Private Cloud vs Hybrid Cloud

Serverless

Understand this often misleading term.

Videos on Azure core concepts