install-docker.sh 649 B

123456789101112131415161718
  1. # install-docker.sh
  2. #!/bin/sh
  3. set -o errexit
  4. set -o nounset
  5. IFS=$(printf '\n\t')
  6. apt remove --yes docker docker-engine docker.io containerd runc || true
  7. apt update
  8. apt --yes --no-install-recommends install apt-transport-https ca-certificates
  9. wget --quiet --output-document=- https://download.docker.com/linux/ubuntu/gpg | apt-key add -
  10. add-apt-repository --yes "deb [arch=$(dpkg --print-architecture)] https://download.docker.com/linux/ubuntu $(lsb_release --codename --short) stable"
  11. apt update
  12. apt --yes --no-install-recommends install docker-ce docker-ce-cli containerd.io
  13. systemctl enable docker
  14. printf '\nDocker installed successfully\n\n'