Container& Docker1
Container& Docker1
Container - diagram
Defining containers
• Containers are lightweight packages of your application
code together with dependencies such as specific
versions of programming language runtimes and
libraries required to run your software services.
Containers- benefits
• Like virtual machines, containers allow you to package your
application together with libraries and other dependencies,
providing isolated environments for running your software
services. As you’ll see below, however, the similarities end here
as containers offer a far more lightweight unit for developers
and IT Ops teams to work with, carrying a myriad of benefits.
• Containers are much more lightweight than VMs
• Containers virtualize at the OS level while VMs virtualize at the
hardware level
• Containers share the OS kernel and use a fraction of the
memory VMs require
Benefits –continued
• Less overhead
Containers require less system resources than traditional or hardware virtual machine
environments because they don’t include operating system images.
• Increased portability
Applications running in containers can be deployed easily to multiple different operating
systems and hardware platforms.
• Greater efficiency
Containers allow applications to be more rapidly deployed, patched, or scaled.
• 1. Docker Containers
• Docker Containers contain binaries, libraries, and configuration files along with
the application itself.
• They don’t contain a guest OS for each container and rely on the underlying OS
kernel, which makes the containers lightweight.
• Containers share resources with other containers in the same host OS and
provide OS-level process isolation.
• 2. Virtual Machines
• Virtual Machines (VMs) run on Hypervisors, which allow multiple Virtual Machines
to run on a single machine along with its own operating system.
• Each VM has its own copy of an operating system along with the application and
necessary binaries, which makes it significantly larger and it requires more
resources.
• They provide Hardware-level process isolation and are slow to boot.
Docker file
A Dockerfile is a text document that contains commands that are used to assemble an image. We can
use any command that call on the command line. Docker builds images automatically by reading the
instructions from the Dockerfile.
The docker build command is used to build an image from the Dockerfile. You can use the -f flag with
docker build to point to a Dockerfile anywhere in your file system.
Docker runs instructions of Dockerfile in top to bottom order. The first instruction must be FROM in
order to specify the Base Image.
What is a kubernetes
• Kubernetes is a portable, extensible, open source
platform for managing containerized workloads and
services, that facilitates both declarative configuration
and automation. It has a large, rapidly growing
ecosystem. Kubernetes services, support, and tools are
widely available.
• The name Kubernetes originates from Greek, meaning
helmsman or pilot. K8s as an abbreviation results from
counting the eight letters between the "K" and the "s".
Kubernetes architecture
Describing kubernetes
• Kubernetes provides a flexible architecture for
discovering services within a cluster while maintaining
loose connections. A Kubernetes cluster comprises a set
of control planes and compute nodes. The primary role
of the control plane is to oversee the entire cluster,
expose the API, and manage the scheduling of compute
nodes according to the desired settings. The compute
nodes run container runtimes such as Docker, alongside
a communication agent called kubelet, which interacts
with the control plane. These nodes can consist of
physical servers, virtual machines (VMs) in on-premises
or cloud environments.
What kuberenetes can do?
Advantages
Use cases
Benefits of kubernetes