Why I Started Using Containers
Why I Started Using Containers
Containers offer a variety of benefits, including extensibility, ease of use, and low overhead. Here's why one dev grew to love them.
Join the DZone community and get the full member experience.Join For Free
Insight into the right steps to take for migrating workloads to public cloud and successfully reducing cost as a result. Read the Guide.
I’ve been using containers for nearly three years, initially working on the technical support team helping customers solve problems in their applications and giving advice about best practices to run containers. Today, I work on a team where we develop containers to use in our OpenShift environment, and because of my technical support background, my troubleshooting skills helped me in this task.
I run containers for most of my tasks, and it makes my life easier. I can run any software on containers, whether for evaluation or even use in my websites. Let’s face the facts: Containers are becoming more common across the companies. Google can spin up thousands of containers a day in their data centers without downtime, Netflix launches more than 1 million containers a week, and many other companies, whether small or large, use containers in production to achieve a new level of scalability. With this in mind, I’d like to list six main reasons why I started to use containers.
Containers Are Simple
There’s nothing better than using the KISS principle in my work, so why not use simple tools to make my job better? I say containers are simple because I can have an operating system and an entire software stack running on my machine with just two or three commands. Because of that simplicity, I can save a lot of time and effort running containers, rather than creating VMs, installing the OS, and installing the software. I can really focus on what matters.
Containers Are Lightweight
The good thing about containers is the way they operate directly on top of the OS (Linux) layer, without the hypervisor layer in the middle. This makes containers use fewer resources than virtual machines, and I can spin up more containers on the same hardware than VMs. Containers also use less storage than VMs, which is more attractive to run. Just as an example, the RHEL 7 image size is 193MB, and there is an alternative RHEL version (which we call RHEL Atomic) that's less than 80MB. Because of the image size, the bootstrap time is less than any traditional way to run an OS. Although the boot time of a RHEL installation, either on VMs or bare metal machines, is about 1 minute, running inside containers can take no more than 15 seconds.
No More "Works on My Machine"
Containers are immutable, period. What makes this feature important to me? It guarantees that a container running on my laptop will run the same way on any machine. No more excuses like “It works on my machine” anymore. Now, with containers, it’s possible to avoid that. You can even run on cloud providers like AWS, IBM Bluemix, Google Cloud Platform, or even Azure and get the same behavior.
Large Community Support
Think about the software you’d like to run with containers. I’m sure that if you can’t find an image with the software you want, there is someone creating it and it will be available soon in any repository. Most companies are creating images of their software to run on containers, and you can use them to create your own configuration. Besides that, there are lots of books (both paid and free) about containers and how to develop, run, and make them more secure.
Containers Are Extensible
You found an image to run, but you are a missing specific configuration or a piece of the software that is required in your environment. With containers, it’s possible to extend an existing image and add things you need in your container, thus making your image fit better for your requirements. That way, the time spent preparing the OS to run your software is much less than any other method. Even using DevOps tools like Puppet, Chef, and others, the time to prepare an environment to run software is even more than spinning up a new container.
Containers Are Cloud-Ready
Cloud computing is the next-generation of computing, where you can add resources on-demand in your environment, using them as you need them, and collecting usage metrics about them. Containers bring all these requirements and more to cloud computing in their design because they are simple to replace in case of any problems. You don’t need to worry if you lose a container because the most advanced cloud computing architectures already manage that for you and spin up a new container to replace the one that became unresponsive.
Published at DZone with permission of Ricardo Martinelli Oliveira , DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.