I've decided to spin up a new VM to see what all the fuss abut Docker is about. I'll be following the guide on the official docker docs website which I will link to at the bottom of the post.
I'm going to set it up using repositories so that it will be easier to update in the future.
First i updated the package index and installed the ability to use repositories over https:
sudo apt-get update
sudo apt-get install \ apt-transport-https \ ca-certificates \ curl \ gnupg-agent \ software-properties-common
Then I added Dockers GP key with
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
I set up the repository for amd 64bit with
sudo add-apt-repository \ "deb [arch=amd64] https://download.docker.com/linux/ubuntu \ $(lsb_release -cs) \ stable"
Run a package update again and then use
sudo apt-get install docker-ce docker-ce-cli containerd.io to install docker
Then to test that it was working I ran
sudo docker run hello-world
It seems everything was installed correctly so I'm going to move on to some post install
To enable Docker to start on boot I'll simply run
sudo systemctl enable docker
I'll also add docker as a user and group so that it can be accesses more easily from a non root-user account
sudo groupadd docker
sudo usermod -aG docker $USER
You should be able to run commands without sudo now.