How to Install docker on Ubuntu 16.4 desktop

how-to-install-docker-on-ubuntu-16-4-desktop

Docker provides container software that is ideal for developers and teams looking to get started and experimenting with container-based applications.
If you are looking to explore docker then a local install on Ubuntu desktop is a good place to start.
The following steps should get you up and running with docker on Ubuntu.

Steps

  1. Log into your workstation and open a terminal.
  2. Run the following command to check if there are any older version of docker installed and uninstall if there are.

  1. Before you install Docker CE for the first time on a new host machine, you need to set up the Docker repository. Afterward, you can install and update Docker from this repository.
    To find out more about Ubuntu repositories, check the following link.

https://help.ubuntu.com/community/Repositories/Ubuntu

  1. To set up your repository run the following commands.

sudo apt-get update

  1. Install packages to allow apt to use a repository over HTTPS

sudo apt-get install \

    apt-transport-https \

    ca-certificates \

    curl \

    software-properties-common

  1. Add Docker’s official GPG key with the following command

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add –

To find out more about gpg keys check out the following link

https://www.gnupg.org/

 

  1. Now if you enter the command sudo apt-key list you will see your docker key listed at the bottom of the output.

  1. Use the following command to add the repository as a stable

sudo add-apt-repository \

   "deb [arch=amd64] https://download.docker.com/linux/ubuntu \

   $(lsb_release -cs) \

   stable"

  1. Now you are ready to install docker.
    First run sudo apt-get update
    Then run sudo apt-get install docker-ce

  1. Docker should now be installed. To confirm type docker –version and hit enter

  1. To verify docker is working correctly type sudo docker run hello-world.
    This command downloads a test image and runs it in a container. When the container runs, it prints an informational message and exits.

You should see the following

If you see the Hello from docker message it means your install was successful.

 

  1. You should now explore docker a bit more by running through the getting started tutorials on the docker website

https://docs.docker.com/get-started/