Preparing a standard Ubuntu box to be a Docker Host - uthomelabs/guides GitHub Wiki

Prereqs

  • Some compute (real or virtual)
  • An Ubuntu machine (this guide is going to use 20.04, but it is suggested to stick with LTS)
  • An internet connection

Getting Started

If you aren't starting with a clean machine, let's make sure to remove old versions first

sudo apt-get remove docker docker-engine docker.io containerd runc

Now that that's out of the way, time for some dependencies

sudo apt-get update
sudo apt-get install ca-certificates curl gnupg lsb-release

Now that that's done, let's import the docker repo and it's official GPG key

sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
  $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

Rad....all set there...on to updating our package indexes and installing docker:

sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin

Moment of truth, let's make sure we did it right:

sudo docker run hello-world

If all is done successfully, you'll be rewarded with this screen here: image

That's it! Let's start building some stuff!