Skip to content

Commit

Permalink
Installing docker with official repo steps
Browse files Browse the repository at this point in the history
  • Loading branch information
TechDufus committed Dec 22, 2023
1 parent 4406796 commit 790bd7e
Showing 1 changed file with 43 additions and 3 deletions.
46 changes: 43 additions & 3 deletions roles/docker/tasks/ubuntu.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,50 @@
---
- name: "Docker | Install"
# These steps are based on the official Docker documentation: https://docs.docker.com/engine/install/ubuntu/#installation-methods
- name: "Docker | Update APT cache"
ansible.builtin.apt:
update_cache: true
become: true

- name: "Docker | Install dependencies"
ansible.builtin.apt:
name:
- ca-certificates
- curl
- gnupg
state: present
become: true

- name: "Docker | Add Docker’s official GPG key"
ansible.builtin.apt_key:
url: https://download.docker.com/linux/ubuntu/gpg
keyring: /etc/apt/keyrings/docker.gpg
state: present
become: true

- name: "Docker | Get System Architecture"
ansible.builtin.command: "dpkg --print-architecture"
register: dpkg_architecture
changed_when: false
failed_when: false
check_mode: false

- name: "Docker | Add Docker’s stable repository"
ansible.builtin.apt_repository:
filename: docker.list
repo: deb [arch={{ dpkg_architecture.stdout }} signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu {{ ansible_distribution_release }} stable
state: present
become: true

- name: "Docker | Install Docker Engine"
ansible.builtin.apt:
name:
- docker
- docker-compose
- docker-ce
- docker-ce-cli
- containerd.io
- docker-buildx-plugin
- docker-compose-plugin
state: present
update_cache: true
become: true

- name: "Docker | Enable service"
Expand Down

0 comments on commit 790bd7e

Please sign in to comment.