DEV Community

Discussion on: Explain Containers Like I’m Five?

Collapse
 
nestedsoftware profile image
Nested Software • Edited

Docker is probably the most well-known kind of container. A container is a way of packaging up a piece of software so that it can be deployed in one step on any system, as long as it supports that container.

You set up everything needed by your software (db, web server, libraries, images, html, whatever) in the container and test it locally. If the software works, you can upload your container image to the cloud, or wherever, and it should continue to "just work"!

Consider the alternative: Let's say you have a linux machine at home that you're using for development. You've installed a variety of software and libraries on that machine, and you've developed a web app that works locally. How would you upload it to a production server? Chances are you'd have to write one or more bash scripts that try to install and configure everything to work on the target machine. However, that machine may be running a different flavour or version of linux, or a different shell, and your scripts might not work properly. On the other hand, once you've got your software working in a container like docker, then you can just deploy your docker image to another docker container. You don't have to run the installation and configuration of software again anymore.

Container images provide standardization of the environment while at the same time offering good performance characteristics, because the interface between the container and the host operating system is quite lightweight. There is probably quite a lot of variety in the details of how different container systems work, but I think this is the main takeaway from an eli5 point of view.

docker.com/resources/what-container