Moving to Containers

It seems that containers are the new technology within IT that everyone is trying to incorporate into their infrastructure. And why? Containers not only benefit those in DevOps, but have positive implications for all teams involved in product delivery.

At Immerse, we’ve recently moved our infrastructure to a containerised solution. It’s early days to analyse the impact that this has had on our development teams, but I thought it would be a good opportunity to deepen my understanding of the this technology.

What Are Containers?

Containers give us the ability to store a number of different systems virtually within the same location. This means that if one environment needs a website front-end, server and database in order to function, all of these can be stored within the same place.

What sort of systems can be run within containers? Well, that’s where container images come in.

What Are Images?

A container image is a stand-alone, executable package of a software that has everything needed to run it including code, runtime, system tools, system libraries, and settings.

An image is required in order to build a container, otherwise it will be empty when created.

So where did all this new tech come from then? It seems like it’s come out of nowhere but spread fast (kinda like Bitcoin right?). Well, it all started by a small company now called Docker Inc. They created the system that containers run on, Docker.

What is Docker?

Docker is a computer program that allows you to perform operating-system-level virtualization known as containerization. This is the creation of containers.

Docker allows independent containers to run within a single Linux instance. This reduces the overhead of starting and maintaining virtual machines (VMs).

Since Docker began, there are other tools than have been developed that can perform containerization.

The World Before Containers

Before we used containers, there were virtual machines (VMs). VMs remove the need for physical hardware and allows one server to be turned into multiple servers. App of this is possible because of a hypervisor.

A hypervisor (also considered a VM monitor), is software that creates and runs VMs. It is the reason why you can run many VMs on a single machine. Each VM will have a full copy of the required operating system, one or more applications and the needed binaries and libraries. All of this can take up tens of gigabytes of space!

Some companies have made the switch to containers from VMs because:

  1. VMs can also be slow to boot, while you can spin up a container within a few minutes providing you have the right image. And if the don’t, that usually only takes a few minutes to obtain.
  2. You can pack a lot more of your companies applications into a single physical server using containers than a what you can fit in a VM.
  3. VMs take up a lot of system resources as they not only just run a full copy of an operating system, but a virtual copy of all the hardware that the operating system needs to run. All that a container needs is enough of an operating system, supporting programs and libraries, and system resources to run a specific program.
  4. With containers you can create a portable, consistent operating environment for development, testing, and deployment.

So How Do You Manage Containers?

Container Orchestration are frameworks that are used to integrate and manage containers. These are not necessary for everyone using containers. Usually enterprise level organisations are more likely to use orchestration tools as they manage a large range of containers and their images. Examples of these tools are Kubernetes, ECS and Ansible.

These tools help to simplify container management from the initial deployment to managing multiple containers, scaling for load, availability, or networking.

The Benefits and Drawbacks

Like any new piece of technology or tool, containers too have their own list of benefits and drawbacks that mean you choose to either integrate them into your development pipeline or you don’t. So, what do containers offer?

Benefits

  • The ability to spin up whole environments consisting of all the systems you need within minutes.
  • The ability to change the configuration and deploy those changes quickly.
  • Containers allow all users of the system to be self contained. This mean that rogue developers who develop new features, don’t run tests locally, push to the test environment, then leave to go home only for QA to find that test is broken is no longer a daily issue (wow, that sounded like a rant!).
  • Features can be tested in isolation easily.
  • Testers can be in control of checking out and pushing features to the test environment.
  • Differences between environments is no longer an issue because they’re all spun up from the same set of stable images

Drawbacks

  • Initially, there maybe some complexity to setting up containers.
  • There are some security issues that you med to be aware of when using containers. For example, if a user or application has superuser privileges within the container, the underlying operating system could, in theory, be cracked.
  • It’s time intensive to set up decent security measures for containers. There’s no default, out if the box solution yet
  • Everyone is making container images and it could be easy to download something malicious into your system.
  • Breaking deployments into more functional discrete parts is smart, but that means we have more parts to manage. There’s an inflection point between separation of concerns and container sprawl!
  • Containers tend to lock you into a particular operating system version

Are containers the future of development?

It seems because of the fast adoption of containers that they may eventually replace VMs once their issues have been overcome. And because it is a new technology, there will be drawbacks at this early stage so don’t let these deter you from experimenting with the tech yourself on your own projects.

However, technology has changed extremely fast over the last 30 years, so it may be that containers are superseded by a new emerging technology that solves the drawbacks of containers and gives us a while load of other benefits too.

For more information of containers especially if you’re learning the basics, please check out the Docker videos by Nigel Poulton on Pluralsight. I found these videos extremely helpful in delivering information and background about a brand new technology. The concepts were also broken down into easy to understand topics which is perfect for beginners. After watching them, I was able to understand a lot more and felt more confident when speaking to the DevOps at Immerse about how they had implemented container and why they made the decisions they did.

What’s your experience with containers? Do you love them? Are they growing on you? Or, have you not yet made the leap into using them? Whatever your experience, I hope this article has given you a better insight into the background of containers.

For more information about containers, please feel free to view the references I used:

This post was exported in one click from Google Docs into WordPress with Wordable.