---
- name: Add Docker PGP key
apt_key:
keyserver: keys.openpgp.org
id: 0x8D81803C0EBFCD88
state: present
- name: Add Docker apt repository
apt_repository:
repo: 'deb [arch=arm64] https://download.docker.com/linux/ubuntu focal stable'
update_cache: true
- name: Install Docker
apt:
name: "{{ pkgs }}"
vars:
pkgs:
- docker-ce
- docker-compose-plugin
- name: Create docker-compose symlink
file:
src: /usr/libexec/docker/cli-plugins/docker-compose
name: /usr/local/bin/docker-compose
state: link
- name: Install Python bindings for Docker
pip:
executable: pip3
- docker
- docker-compose
- name: Copy Docker daemon config file
template:
src: daemon.json.j2
dest: /etc/docker/daemon.json
owner: root
mode: u=rw,g=r,o=r
- name: Set up Docker services
import_tasks: services.yml
tags:
- boot
- services