Docker in macOS
I have finally managed to install Docker CE on a freshly CentOS 8.1 installed dedicated server. Now is the time to learn Docker module in Ansible.
Instead of using Ansible’s shell or command functionality to form/start/stop Docker containers, it’s much better to use a Docker module.
For CentOS 8.x images, here’s the Ansible playbook fragment that gets the Docker module installed on a server:
Here’s the example from Ansible documentation:
In this example you can see how easy it is to specify a Docker container’s name, base image (busybox in this case) and even map volumes from physical host (that /storage thing).
WARNING: this is not a complete example yet. I think more parameters need to be specified before this becomes a usable container named unixtutorial-server.
I have a number of Docker images that I plan on storing using self-hosted Docker registry. They’ll be pulled and formed into clusters using Ansible.
I’m not 100% sure, but it may well be that whole Dockerfiles (read: Docker stacks) can be created and orchestrated using Ansible – we’ll see.