Installing Docker on Ubuntu 16.04
17 Nov 2018I've had reason to start playing with containers on Ubuntu. The first step was to get docker installed and working on my laptop.
- I needed to add the GPG key for Docker to my system.
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
2. Next I needed to add the Docker repository to APT and refresh the package database.
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get update
3. Finally, install Docker:
sudo apt-get install -y docker-ce
After about 30 seconds the install was completed. I verified that everything installed correctly and was active by running the command:
sudo systemctl status docker
Docker needs to run with elevated privileges. Rather than typing sudo before each command, I added my user account to the docker user group:
sudo usermod -aG docker ${USER}
su - ${USER}
Running the following command will verify that it worked correctly:
id -nG
todd adm sudo lpadmin sambashare docker
Pretty straightforward to install a piece of software as powerful as Docker. So far, I'm loving the change to Linux.