Without going into the details of Linux I’ll try and explain Docker in a few lines, this won’t be a long post.
- Docker is a tool that allows you to spin up containers within seconds.
- Containers can be thought of as Virtual Machines but much more lightweight and portable. They are basically miniature operating systems.
- Containers are based on Images.
- An Image is a file made up of multiple layers of instructions.
I came up with a poor programming analogy to help myself understand this. An Image is a Class, and the container is the instantiated object.
Docker can be run on both Linux and Windows hosts and there are now both Linux containers and windows containers.
There are quite a few benefits to using them, I’ll only mention a few to keep the read short:
- Acts as a sandbox environment. You could spin up a Debian container play around in it and if you broke anything you could just throw it away and spin up a new one in seconds.
- Aids in rapid and continuous deployment
- Makes CI quite easy and efficient
- Ensures your apps and resources are isolated and segregated
The main benefit for me is how it allows us to package up an application with all of the parts it needs, such as libraries, dependencies, and ship it as one package, and we know that it will work on whatever machine it is being run on.
Photo by Fancycrave