You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
1.2 KiB

  1. ---
  2. - hosts: [ 'debian10' ]
  3. tasks:
  4. - name: Remove old packages
  5. shell: |
  6. for pkg in docker.io docker-doc docker-compose docker-compose-v2 podman-docker containerd runc; do apt-get remove $pkg; done
  7. apt-get autoremove
  8. - name: Add APT repository
  9. shell: |
  10. apt-get update
  11. apt-get install ca-certificates curl
  12. install -m 0755 -d /etc/apt/keyrings
  13. curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
  14. chmod a+r /etc/apt/keyrings/docker.asc
  15. echo \
  16. "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
  17. $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
  18. tee /etc/apt/sources.list.d/docker.list > /dev/null
  19. apt-get update
  20. - name: Install Docker
  21. shell: |
  22. apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
  23. - name: Test hello-world
  24. shell: |
  25. docker run hello-world