This script assumes you have never installed Docker.
curl -fsSL <RAW LINK TO install-docker.sh> | sudo sh -
#!/bin/bash | |
apt-get update | |
apt-get install -y \ | |
apt-transport-https \ | |
ca-certificates \ | |
gnupg-agent \ | |
software-properties-common | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - | |
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | |
apt-get update && apt-get install -y docker-ce docker-ce-cli containerd.io |