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.

33 lines
1.3 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. # Add Docker's official GPG key:
  11. apt-get update
  12. apt-get install ca-certificates curl
  13. install -m 0755 -d /etc/apt/keyrings
  14. curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
  15. chmod a+r /etc/apt/keyrings/docker.asc
  16. # Add the repository to Apt sources:
  17. echo \
  18. "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
  19. $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
  20. tee /etc/apt/sources.list.d/docker.list > /dev/null
  21. apt-get update
  22. - name: Install Docker
  23. shell: |
  24. apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
  25. - name: Test hello-world
  26. shell: |
  27. docker run hello-world