Deprecated: Please use geerlingguy.docker instead. On modern distributions, Docker should install just fine on Arm or X86 (or even RISC-V!) using that role.
An Ansible Role that installs Docker on Linux, specially tailored for ARM-based computers like the Raspberry Pi.
Besides the documentation here, please see the Raspberry Pi Dramble for an example of this role in action, being used with multiple Raspberry Pis to build a Kubernetes cluster, or Drupal Pi for an example of use with a single Raspberry Pi.
If installing Docker Compose, requires Python Pip already be installed (you can use geerlingguy.pip to install it).
Available variables are listed below, along with default values (see defaults/main.yml):
docker_version: latest
The version of Docker to install. You can specify an exact version to lock it in (check for available versions with apt-cache madison docker-ce).
docker_install_recommends: false
Whether to install recommended packages alongside docker-ce.
docker_install_compose: true
Whether to install Docker Compose via Pip.
docker_users:
- user1
- user2
A list of system users to be added to the docker group (so they can use Docker on the server).
docker_pip_executable: pip3
Set this to pip for Python 2 or pip3 for Python 3.
Many users of this role wish to also use Ansible to then build Docker images and manage Docker containers on the server where Docker is installed. In this case, you can easily add in the docker Python library using the geerlingguy.pip role:
- hosts: rpi
vars:
pip_package: python3-pip
pip_install_packages:
- name: docker
roles:
- geerlingguy.pip
- geerlingguy.docker_armNone.
- hosts: rpi
vars:
pip_package: python3-pip
roles:
- geerlingguy.pip
- geerlingguy.docker_armMIT / BSD
This role was created in 2019 by Jeff Geerling, author of Ansible for DevOps.