Docker Tutorial Part 3 -> Setup and installation on Ubuntu

Installing docker on Linux is as simple as installing any other Linux package, We don’t require the whole Docker toolbox for working with docker on Linux.

In this blog post, I will be talking about installing community edition installation of Docker.

To install Docker, you need the 64 bit version of either one of below Ubuntu-

  • Xenial 16.04 (LTS)
  • Trusty 14.04 (LTS)
  • Yakkety  16.10

Uninstall older version of Docker – Older version of Docker called docker or docker-engine. if you have these then uninstall them, otherwise skip this part

sudo apt-get remove docker docker-engine

Install Docker – You can install the Docker in different ways, as per your needs

  1. Setup docker repositories and install from them – this is easy in installation and upgrades (recommended approach)
  2. Download the DEB package and install it manually and also manage upgrades manually (prefer when lack of internet access)

Install using Repository – If you are doing the setup for the first time on a new host machine, you need to setup the docker repository. Then you can use the same repository for install and updates

  • Install packages to allow apt to use a repository over HTTPS:
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
  • Add Docker’s official GPG key :
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
  • Verify that the key fingerprint is 9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88
sudo apt-key fingerprint 0EBFCD88

pub   4096R/0EBFCD88 2017-02-22
      Key fingerprint = 9DC8 5822 9FC7 DD38 854A  E2D8 8D81 803C 0EBF CD88
uid                  Docker Release (CE deb) <docker@docker.com>
sub   4096R/F273FCD8 2017-02-22
  • use the below command to setup the stable repository
sudo add-apt-repository \
   "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
   $(lsb_release -cs) \
   stable"
  • Update the apt package
sudo apt-get update
  • Install the latest / specific version of Docker with below commands
sudo apt-get install docker-ce   //for latest version
sudo apt-get install docker-ce=  //for specific version
  • Verify that Docker CE is installed correctly by running a sample hello-world docker image-
sudo docker run hello-world
  • You should see something like below if your installation is successful and complete

docker-linux

If you guys face issues in installation , please mention in comments section.

In the next blog post , we would be learning docker terminology and different docker components

To know more in details, hands-on and for personal / corporate training please reach out to – gauravtiwari91@yahoo.com

Advertisements

3 thoughts on “Docker Tutorial Part 3 -> Setup and installation on Ubuntu

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s