Skip to content

Commit 78358d5

Browse files
committed
install docker
1 parent af83c9b commit 78358d5

3 files changed

Lines changed: 40 additions & 0 deletions

File tree

roles/docker/tasks/main.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
3+
- name: Install Containerd 1.4.6
4+
apt:
5+
deb: https://download.docker.com/linux/ubuntu/dists/focal/pool/stable/amd64/containerd.io_1.4.6-1_amd64.deb
6+
state: present
7+
8+
- name: Install Docker CE CLI 20.10.7
9+
apt:
10+
deb: https://download.docker.com/linux/ubuntu/dists/focal/pool/stable/amd64/docker-ce-cli_20.10.7~3-0~ubuntu-focal_amd64.deb
11+
state: present
12+
13+
- name: Install Docker CE Engine 20.10.7
14+
apt:
15+
deb: https://download.docker.com/linux/ubuntu/dists/focal/pool/stable/amd64/docker-ce_20.10.7~3-0~ubuntu-focal_amd64.deb
16+
state: present

site.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@
1616
- { role: cache, tags: "cache" }
1717
- { role: git, tags: "git" }
1818
- { role: vscode, tags: "vscode" }
19+
- { role: docker, tags: "docker" }

spec/test_docker.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
2+
def test_containerd_package_is_installed_at_version_1_4_6_(host):
3+
assert host.package('containerd.io').is_installed
4+
assert '1.4.6' in host.package('containerd.io').version
5+
6+
def test_containerd_version_command_reports_1_4_6_(host):
7+
assert '1.4.6' in host.run('containerd -v').stdout
8+
9+
10+
def test_docker_cli_package_is_installed_at_version_20_10_7_(host):
11+
assert host.package('docker-ce-cli').is_installed
12+
assert '20.10.7' in host.package('docker-ce-cli').version
13+
14+
def test_docker_cli_version_command_reports_20_10_7_(host):
15+
assert '20.10.7' in host.run('docker -v').stdout
16+
17+
18+
def test_docker_engine_package_is_installed_at_version_20_10_7_(host):
19+
assert host.package('docker-ce').is_installed
20+
assert '20.10.7' in host.package('docker-ce').version
21+
22+
def test_docker_engine_version_command_reports_20_10_7_(host):
23+
assert '20.10.7' in host.run('sudo docker version --format "{{.Server.Version}}"').stdout

0 commit comments

Comments
 (0)