A container consists of an entire runtime environment bundled into one package. In simple terms we can say it contains an application all its dependencies, libraries and other binary files configuration files that are needed to run it. Multiple containers can run on a single host. Containers are sometimes represented as a shipping container.

Containers have actually been around for awhile. LXC (Linux Containers) were introduced nearly a decade ago but their use was, for obvious reasons, limited mainly to Linux developers. Containers did not catch on right away because, although a powerful technology, they can also be difficult to use. But that changed with Docker, the open source container platform that makes container technology easy to use. And that arguably jump-started the current micro-services revolution. 


There is a significant trend in the industry to move towards containers from virtual machines for deploying software applications. The main reasons for this are the flexibility and low cost that containers provide compared to virtual machines. Everyone’s container journey starts with one container. The popularity of containers is growing exponentially. You discover you need more containers for complex applications so you add more. At first the growth is easy to handle but soon, it is overwhelming, and chaos reigns.

Containers are great, but when you get lots of them running, at some point, you need them all working together to solve business problems. In other words, all those wonderful, nifty containers need to be orchestrated. You can gain control of your containers and orchestrate them with container orchestrators like Kubernetes (will cover in upcoming blogs). Let\’s explore the basics of containers in this one.


Why Containers?
Image result for Why containersContainers are a solution to the problem of how to get software to run reliably when moved from one computing environment to another.  
Potential scenarios :

  • From a developer\’s notebook to a test environment
  • From a staging environment into production
  • From a physical machine in a data centerto a virtual machine in a private or public cloud

Basics of Containers ?

    Related image

  • The analogy with shipping containers is that many containers can be combined on the same host just as many shipping containers can be combined on one ship. Like shipping containers revolutionised the overseas import/export industry by making the shipping payload opaque and standardised, containers allow the kind of application isolation developers seek without the overhead of the hypervisor. A container is such an isolated environment where one or more processes can be run. Containers focus on process isolation and containment instead of emulating a complete physical machine.
  • By containerising the application platform and its dependencies, differences in operating system distributions and underlying infrastructure are abstracted away.  Developers can use containers to pack, ship, and run any application as a lightweight, portable, self-sufficient LXC container that can run virtually anywhere. Developers make sure the software has the right dependencies in place to run correctly. 
    Image result for software containers

  • Just as a container image ensures consistency among various environments, it guarantees a level of isolation from other applications running on the target host (without the overhead of the virtualization Hypervisor). So integration becomes a non-issue as you can run the application virtually anywhere (after also resolving dependencies). 
  • Once all the dependencies are resolved (for example, through a Maven build), containers ensure they are consistent from one environment to the next through the container image. As the application matures, its dependencies naturally change. But once it is working, you modify the image, and now it just works in every environment to which you deploy the application. So when your colleague needs to run the code, they download the image, along with the code, and dependencies, and it just runs. 
  • Platform-as-a-Service (PaaS) providers ensure that containers deploy and run consistently from one environment to the next. Any cloud provider that runs Docker (covered in another blog here) can be configured so that you just push your container image to the cloud and your application runs. Ultimately, containers help achieve faster development turnaround, application isolation, and consistency among deployments, resulting in ease of integration and better DevOps experiences.

-Ritesh

Disclaimer: “The postings on this site are my own and don’t necessarily represent IBM’s positions, strategies or opinions.”