Under normal circumstances, in a live environment at a customer, I would not install Docker via
cloud-init
. For our project it is fine, and it is good to show some of the capabilities, but you would normally install this via, for example, an Ansible role.
Docker the software consists of 3 main pieces which, again, many don’t know but is essential.
- The Docker daemon. This runs continuously in the background, managing all Docker objects
- The Docker rest API. This is the interface Docker clients use to talk to the Docker daemon, giving instructions to the daemon
- The Docker CLI, or the Docker client if you will. With the Docker CLI you’re giving the commands. The CLI interacts with the API, which talks to the daemon
There are thousands of public images
out there and from an image you can run a container. A container has all dependencies to run its main process. For instance, with the Nginx image you can run a Nginx container that has all dependencies to run the Nginx process. You get a consistent and isolated environment, no matter where you run the container. It’s flexible and portable and awesome for automation.
Henk Batelaan