[No Audio]
In this demo, we will install Docker on Ubuntu 16.04 or Ubuntu Xenial.
Let's start off with running a standard 'apt-get update' command.
Once we are done with that,
let's install some of the prerequisites,
such as 'apt-transport-https', to make
sure that our machine can communicate through HTTPS,
authority certificates, curl and software-properties-common,
which contains some of the Golang objects which will be used by Docker.
[No Audio]
And the installation is successful.
[No Audio]
Now let's download GPG Key for Docker and add it to our machine.
And to make sure that we don't get a long list of processes
which happen in the background,
let's use '-fsSL' flag to keep our result as small as OK.
And it shows OK, which means we got our gpg key.
Let's verify this key using 'sudo apt-key fingerprint' command.
We can verify that we have received the correct key by searching
for the last eight characters of the fingerprint, which should
be '0EBF CD88'.
This information is provided by Docker itself,
so there is not much for you to figure out.
And yes, our key does have those characters as its last 8 digits.
Now, run this command to add a repository called stable
and add the content of 'download.docker.com/linux/ubuntu' on it.
We have provided the flag 'lsb_release -cs'
to make sure that Docker provides correct files, which means files
for Ubuntu Xenial or Ubuntu 16.4 to our stable repository.
[No Audio]
Let's run the update again to reflect the changes.
[No Audio]
Run 'sudo apt-get install docker-ce' to finally install Docker
'-ce' stands for Community Edition, which is one of
the two editions provided by Docker.
The other one is called the Enterprise Edition, which is
not free, so we won't be including it in this course.
[No Audio]
The process has ended and we have successfully installed
docker-ce or Docker Community Edition.
[No Audio]
Verify that our installation is successful,
by running 'sudo docker run hello-world' Command.
This will run a container called hello-world, which would
only be possible if the Docker installation was successful.
You don't have to pay much attention to the processes which
are going on, because we will be exploring all of them
in sufficient depth in further modules.
As it says, our installation appears to be working correctly.
You may have noticed that we have been using root privileges
over and over, to make sure that you can run Docker from your
regular user as well.
Let's perform a few more steps.
First, let's add a group called docker using 'sudo groupadd docker'.
Now let's add a user which is dhwani to this docker group
and provide it root privileges.
Now let's try to run a hello-world container without root
privileges with just docker run hello-world command
and we get the same results.