Install The Docker Engine

ds_docker

This Ansible role installs the Docker Engine Community Edition from the official Docker repository.

Prerequisites

  • Debian 12+ or compatible
  • root access or sudo privileges

Defaults

docker_remove:
  - docker_engine
  - docker
  - docker.io
  - containerd
  - runc

docker_prerquisites:
  - ca-certificates
  - gnupg

docker_gpg_url: https://download.docker.com/linux/debian/gpg

docker_apt_repo: deb [arch=amd64 signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian trixie stable

docker_install_packages:
  - docker-ce
  - docker-ce-cli
  - containerd.io
  - docker-buildx-plugin
  - docker-compose-plugin

Example Playbook

- name: Install the Docker Engine
  hosts: all
  become: true

  roles:
    - role: ds_docker

Operational Notes

  1. Only the users in the docker group can access the docker socket.
  2. Access to the docker socket equals to root access on the host.
  3. Add the user with usermod -aG docker $USER.

License

MIT

[ Fear the Silence. Fear the Switch. ]

Description
This Ansible role installs the Docker Engine from the official Docker repository.
Readme 52 KiB