There are a few different versions of Ubuntu that are available. In this recipe, we will be installing Docker on Ubuntu 18.04, which is the latest LTS version as of writing. These same steps should also work with Ubuntu 16.04.

Docker Cookbook
By :

There are a few different versions of Ubuntu that are available. In this recipe, we will be installing Docker on Ubuntu 18.04, which is the latest LTS version as of writing. These same steps should also work with Ubuntu 16.04.
Check for the prerequisites mentioned in the previous recipe.
Uninstall any older versions of Docker. Previous versions of the Docker package are called docker, docker.io, or docker-engine. If these are installed, then we need to uninstall them, or else they might cause problems:
$ sudo apt-get remove docker docker-engine docker.io
Go through the following steps:
$ sudo apt-get update
$ sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
software-properties-common
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
OK
Verify that we have the correct key installed:
$ sudo apt-key fingerprint 0EBFCD88
pub rsa4096 2017-02-22 [SCEA]
9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88
uid [ unknown] Docker Release (CE deb) <[email protected]>
sub rsa4096 2017-02-22 [S]
$ sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
$ sudo apt-get update
$ sudo apt-get install docker-ce
$ sudo docker container run hello-world
The preceding command will install Docker on Ubuntu and all the packages required by it.
The default Docker daemon configuration file is located at /etc/docker, which is used while starting the daemon. Here are some basic operations:
$ sudo systemctl start docker
$ docker info
$ sudo apt-get update
$ sudo systemctl enable docker
$ sudo systemctl stop docker
For more information, check out the Ubuntu installation document on the Docker website at https://docs.docker.com/install/linux/docker-ce/ubuntu/.
Change the font size
Change margin width
Change background colour