0% found this document useful (0 votes)
121 views5 pages

Understanding Docker and Containerization

Docker Overview from https://www.google.com.ph/url?sa=t&rct=j&q=&esrc=s&source=web&cd=2&cad=rja&uact=8&ved=0ahUKEwjp3YyN-q7NAhXDQ48KHRxyA3QQFggiMAE&url=http%3A%2F%2Fwww.odbms.org%2Fwp-content%2Fuploads%2F2014%2F11%2FWhat-is-Docker.pdf&usg=AFQjCNEaJINowjQKL9A6jA86oz0AJ4umIA

Uploaded by

robert callanta
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Topics covered

  • LXC,
  • Google Cloud,
  • Portability,
  • Docker Containers,
  • Microservices,
  • Scalability,
  • Deployment Tools,
  • Command Line Interface,
  • Incremental Improvement,
  • Container Management
0% found this document useful (0 votes)
121 views5 pages

Understanding Docker and Containerization

Docker Overview from https://www.google.com.ph/url?sa=t&rct=j&q=&esrc=s&source=web&cd=2&cad=rja&uact=8&ved=0ahUKEwjp3YyN-q7NAhXDQ48KHRxyA3QQFggiMAE&url=http%3A%2F%2Fwww.odbms.org%2Fwp-content%2Fuploads%2F2014%2F11%2FWhat-is-Docker.pdf&usg=AFQjCNEaJINowjQKL9A6jA86oz0AJ4umIA

Uploaded by

robert callanta
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Topics covered

  • LXC,
  • Google Cloud,
  • Portability,
  • Docker Containers,
  • Microservices,
  • Scalability,
  • Deployment Tools,
  • Command Line Interface,
  • Incremental Improvement,
  • Container Management

What is Docker and why use it?

Docker is the poster child of the containerization movement but is it here to stay? Despite the
buzz, many application developers are still undecided about using containers in production. In this
article we will talk about:
- the need for containerization
- Dockers benefits and best use cases
- containerization alternatives in the market
- going into production with Docker in enterprise-grade environments

What are containers?


The advent of web based software, services and platforms along with commoditization of
computing services means that scaling has become of paramount importance. Even more, new
paradigms in software development agile techniques, which shorten the path between the
developer and the production environments, also contributed to an increase in adoption among
enterprises and startups alike. These new development practices and a new set of requirements,
in terms of continuous integration and continuous deployment meant that there was a proper
seeding ground for ideas like containerization.
Containerization tools enable immutability in the infrastructure: container apps that are built on
the spot and in-place with the same configuration and same dependencies as the original authors
intended. This is one of the main reasons (or perhaps even the main driving force) of their rapid
adoption and increased usage. These tools allow application developers to focus on the application
instead of focusing on the infrastructure while bringing versioning to application image distribution.
It even goes as far as bringing concepts that traditionally belonged to a different area: you can do
pulls, pushes and commits on Docker images, concepts borrowed from Source Code Management
Software (like Git and Mercurial).
To get any confusion out of the way, Docker refers both to an open-source project
([Link] as well as the company behind it Docker Inc. (formerly
dotCloud). dotCloud was a PaaS player who built Docker for internal use. Once they realized its
potential, they pivoted and focused exclusively on developing Docker. The importance of the
project in the greater ecosystem was also recognized by most of the industry, thus allowing Docker

Bigstep Cloud Limited


Citypoint, 9th Floor, 1 Ropemaker Street, London, EC2Y 9HT

[Link]

Inc. to raise 40M$ in the most recent funding round. Following the pivot dotCloud (the PaaS
offering of the company) was relocated to Berlin-based cloudControl.
Docker is just one of the available containerization offerings and, as many similar projects, relies
on kernel features that (in Linux) have been available for more than 6 years (since around 2007).
However, as with other technologies (see e.g. boom in smartphone sales with the introduction of
iPhone) Docker has only put a user (and developer) friendly interface around pre-existing
components. The same concepts appeared 2-3 years earlier in Solaris OS (build 51 in Solaris 10),
known as Solaris Containers w/ Solaris Zones. While initially Docker was a wrapper for LXC (LinuX
Containers), nowadays it manages libcontainer a unified interface for cgroups and kernel
namespaces. The gist is: containerization through kernel spaces enables multiple user spaces,
while the users occupying these spaces have no okay, you got me, they have a little
knowledge that other users exists.

Docker vs. Virtualization


While there are a ton of similarities there are also at least two tons of differences between the two.
The most important difference is that, in Docker, theres no overhead introduced by the need to
emulate an entire OS for the virtual machine. As such, Docker provides better performance (in
terms of speed and capacity) when for custom applications in a container, compared to virtual
machines, provided that the VM host and LXC host have the same hardware characteristics.
Another important difference is that, with Docker, the host and the container have to run the same
type of OS.
A less known fact about virtualization is that it has appeared close to 50 years ago at IBM (where
else?), in their CP-40 mainframe and was later introduced into several other product lines (such as
iSeries and zSeries). Just like a plethora of other technologies, the continuous demand for better
performance, better management and easier deployment and the advances in hardware and
software made the concept of virtualization reach the pinnacle of its evolution in the recent years.
Both containers and Virtual Machines address the same problem isolation and control of
components of an application but this is achieved in different way as containers give up some of
the isolation for a more efficient usage of the (host) system resources.

Bigstep Cloud Limited


Citypoint, 9th Floor, 1 Ropemaker Street, London, EC2Y 9HT

[Link]

Why developers love Docker


Docker 101
Docker relies for its execution environment, on features in the hosts kernel LXC. But it also
needs filesystem support in the so called UFS (Union File System).

Docker Filesystems Multilayer


Early versions of Docker relied on AuFS, but more recent releases have adopted a neutral
approach, with a preference for devicemapper. This use of a copy-on-write FS is actually what
makes Docker look like Git (and Docker Hub like GitHub).
Dockers two main concepts are Containers and Images, where Containers are, well, containers
running the application and Images are the Containers-at-Rest (i.e. saved container state). To
make an analogy with class concepts in OOP, Images are class definitions, while Containers
are class instances at run-time.
All in all there are just 28 commands that the tool called Docker (self-entitled self-sufficient
runtime for Linux containers) understands, but they wrap all the mentioned capabilities
including the control (such as start/stop a container) and the meta-management (such as
push/pull to/from the repository).
For instance starting a container running Redis is as simple as*:
docker pull dockerfile/redis
docker run -d --name redis -p 6379:6379 dockerfile/redis
(*note that there are other Redis templates as well)
This will allow one to subsequently use

Bigstep Cloud Limited


Citypoint, 9th Floor, 1 Ropemaker Street, London, EC2Y 9HT

[Link]

<container_host_ip>:6379
to connect to the Redis server. To get a feeling of what Docker is like just visit
[Link] to access a browser based interactive tutorial.
The latest version of Ubuntu Linux (14.04 LTS) comes with activated Docker support. It still
needs to be installed, though thats just an apt-get install [Link].

Docker Benefits
The roles that have most to benefit from Docker are those at the two ends of the development
cycle (developer and dev-ops/sysadmins), but it also improves the lives of everyone else in
between (like QA staff).
Dockers most appreciated benefits are:

application-centric: the incremental improvement that Docker brings on LXC is focus


on deployment of application vs deployment of machines
portability: once published, any image will yield the exact same result wherever it runs
versioning: much like Git, allows commit/push and pulls on existing images, verifying
differences from one commit to the other
automation: there are tools that allow a machine, once running, to reach a specific state
sharing: through the use of Docker Hub anyone can build on existing machines or make
available their images for others
reusability: an image can be fork-ed for two different purposes.

Beyond Docker: are containers here


to stay?
Ecosystem
Docker in itself, but also components and concepts popularized by it, are at the heart of a
multitude of projects which try to build on it. Just as Docker put a friendly face around LXC,
people and companies around the world try to use it to put friendly faces around other
connected areas.
For instance a consortium comprising of the technology behemoths Google, Microsoft and IBM
as well as smaller companies, such as CoreOs, RedHat, Mesosphere and even the apparent
Docker competitor VMWare, is supporting a project called Kubernetes (open-sourced earlier this
year by Google) which tries to dockerize what happens above-and-beyond the container (i.e.
defining logical components that run in different applications but are managed in a cluster as a
single entity). Here is a non-exhaustive list of related (and sometime competitive)
containerization projects:

Bigstep Cloud Limited


Citypoint, 9th Floor, 1 Ropemaker Street, London, EC2Y 9HT

[Link]

[Link] container cluster management.


[Link] Docker powered mini-Heroku. The smallest PaaS
implementation youve ever seen
[Link] open source PaaS that makes it easy to deploy and manage applications on
your own servers
[Link] deployment and control of complex, multi-host
environments using Docker containers possible and easy to use
[Link] Serf is a tool for cluster membership, failure detection, and
orchestration that is decentralized, fault-tolerant and highly available
[Link] Docker plus Mesosphere provides an easy way to
automate and scale deployment of containers in a production environment. Marathon enables
REST API for Mesos
[Link] A deployment tool for Docker. Takes containers from a
Docker registry and runs them on a fleet of hosts with the correct environment variables, host
volume mappings, and port mappings
[Link] Mesos containerizer hooks for Docker
[Link] Fast, isolated development environments using Docker (acquired by
Docker Inc)
[Link] manage Docker resources including containers, hosts and more
[Link]

Is Docker ready for production? All the signs seem to point to YES.
Probably the largest user of containers (based on LXC, not necessarily Docker) in production is
at Google, where everything, from Search to Gmail, is packaged and run in a Linux container.
Each week we launch more than 2 billion container instances across our global data centers,
and the power of containers has enabled both more reliable services and higher, more-efficient
scalability (quote from Google Cloud Platform Blog).
Furthermore, as the decision power shifts (not entirely, but in significant amounts anyway) to the
developers (see e.g. The New Kingmakers by RedMonks Stephen OGrady) and as Docker is a
tool built by developers (primarily) for developers (although Docker Inc. only had approx 30
employees at the time of releasing 1.0, this release came through the shared effort of more than
460 people) the project stroke a chord with a lot of people leading to almost 3M downloads.
Considering that Docker is not a consumer application, this is in itself a remarkable
achievement.

Bigstep Cloud Limited


Citypoint, 9th Floor, 1 Ropemaker Street, London, EC2Y 9HT

[Link]

Common questions

Powered by AI

Several alternative containerization projects aim to expand or compete with Docker: Kubernetes, for managing container clusters; Dokku, a Docker-powered mini-Heroku; Deis, an open-source PaaS; Maestro-NG, for managing complex Docker environments; and Centurion, a Docker deployment tool. Kubernetes enhances Docker by managing clusters, Dokku and Deis simplify application deployment, Maestro-NG facilitates complex environment control, while Centurion optimizes Docker deployment processes by managing environment variables and host configurations .

Google's extensive use of containers, although based on LXC rather than Docker, serves as validation of Docker's readiness for production environments because Google deploys more than 2 billion container instances weekly. Google's success in leveraging containers to achieve reliable services and efficient scalability across its global data centers demonstrates the viability and effectiveness of using container technology like Docker in large-scale production scenarios .

Docker provides several benefits compared to traditional virtual machines: improved performance due to no need for full OS emulation within containers, which leads to faster and more efficient execution. Additionally, Docker promotes application-centric deployment, focus on portability, and versioning akin to Git. It allows automation of deployment processes and facilitates easy sharing and reusability of images through platforms like Docker Hub, making it easier for developers and system administrators to manage applications efficiently .

Docker has borrowed concepts from Source Code Management, such as the ability to perform operations like 'pulls', 'pushes', and 'commits' on Docker images. These operations, akin to those used in systems like Git, offer advantages including simplified versioning, change tracking, and collaborative development. These similarities facilitate efficient image management, enabling developers to manage application deployments with the same agility and control found in code management systems .

The rapid adoption and usage of Docker in enterprise environments can be attributed to the growing importance of scalability in web-based services and platforms, as well as new agile software development practices. Containerization tools like Docker enable 'immutability' in infrastructure, allowing for consistent environments across development and production, which enhances continuous integration and continuous deployment. Docker's ability to focus on application deployment rather than machine management, its portability, versioning capabilities, and wide industry support further contribute to its rapid adoption .

Docker's popularity can be significantly attributed to its ability to put a 'user-friendly interface around pre-existing components'. By simplifying the use of complex Linux kernel features through an accessible interface, Docker has made containerization more approachable for developers who were previously deterred by the intricacies of these underlying technologies. This democratization of technology allows developers to focus on application development rather than infrastructure, which has been a key factor in its widespread adoption .

Docker initially relied on LXC (Linux Containers) for its execution environment but evolved to using libcontainer, which Docker manages directly. Libcontainer provides a unified interface for managing cgroups and kernel namespaces, representing a shift from being merely a wrapper around existing container technologies to controlling its own execution environment. This evolution allows Docker greater flexibility and control over container management and enhances its capability to support diverse Linux kernel features .

Docker's use of the Union File System (UFS) allows it to implement a copy-on-write filesystem, which enables efficient storage management by layering file changes on top of existing filesystem layers. This approach mimics version control systems like Git, allowing developers to push, pull, and commit Docker images with changes stored as deltas rather than full copies. This capability enhances Docker’s functionality in terms of saving storage space, managing versions, and facilitating the sharing and reuse of applications without redundant data .

Kubernetes plays a significant role in Docker's ecosystem by providing a container cluster management system that extends Docker's capabilities beyond individual containers. It allows for organizing containers into clusters, managing them as a single entity, and orchestrating the deployment, scaling, and operation of application containers across clusters of hosts. The collaboration with major tech companies like Google, Microsoft, and IBM highlights its importance in enabling effective container orchestration and management at scale, reinforcing Docker's ecosystem through enhanced functionality .

Docker achieves isolation and control of application components by using containerization through kernel spaces, which allows multiple user spaces to exist on the same host OS without needing separate OS instances. This is different from virtualization, where each virtual machine requires a full OS, adding overhead. Docker's method results in lower overhead and greater resource efficiency, though with reduced isolation compared to virtualization, which fully isolates each VM from the host .

You might also like