This post assume that you know what docker is, if not please check the link here to know more about docker. Currently docker has two variants Docker-CE (Community Edition) and Docker-EE (Enterprise edition). In this post I am installing Docker-CE on to my Ubuntu 16.04 Xenial Desktop. We test the installation by simply running a hello world docker.
Step-1: Remove previous versions of docker if any
We have to remove previous versions of docker if they are already installed. Previous versions are called as “docker” and “docker-engine”
$ sudo apt-get remove docker docker-engine
Step-2: Allow apt to use repositories over https
Install the packages required to allow “apt” to use a repository over https.
$ sudo apt-get install apt-transport-https \ ca-certificates \ curl \ software-properties-common
Step-3: Add Docker’s official GPG key
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
Step-4: Setup stable repository
$ sudo add-apt-repository \ "deb [arch=amd64] https://download.docker.com/linux/ubuntu \ $(lsb_release -cs) \ stable"
Above command returns the name of your Ubuntu distribution such as “Xenial”
Step-5: Install Docker
Run the following commands to install docker:
$ sudo apt-get update $ sudo apt-get install docker-ce
Step-6: Test docker installation
It’s time to test whether docker was successfully installed on not. We run the following command to test it.
$ sudo docker run hello-world
If the installation is successful, you will see the below log on your terminal.
That’s all for now. We see more docker posts in future.