1 00:00:00,000 --> 00:00:02,333 [No Audio] 2 00:00:02,333 --> 00:00:08,966 In this demo, we will install Docker on Ubuntu 16.04 or Ubuntu Xenial. 3 00:00:08,966 --> 00:00:13,000 Let's start off with running a standard 'apt-get update' command. 4 00:00:13,533 --> 00:00:15,300 Once we are done with that, 5 00:00:15,400 --> 00:00:18,100 let's install some of the prerequisites, 6 00:00:18,100 --> 00:00:22,233 such as 'apt-transport-https', to make 7 00:00:22,233 --> 00:00:25,833 sure that our machine can communicate through HTTPS, 8 00:00:26,100 --> 00:00:31,766 authority certificates, curl and software-properties-common, 9 00:00:31,766 --> 00:00:36,800 which contains some of the Golang objects which will be used by Docker. 10 00:00:36,800 --> 00:00:38,466 [No Audio] 11 00:00:38,466 --> 00:00:40,833 And the installation is successful. 12 00:00:40,833 --> 00:00:43,300 [No Audio] 13 00:00:43,300 --> 00:00:48,733 Now let's download GPG Key for Docker and add it to our machine. 14 00:00:49,100 --> 00:00:52,966 And to make sure that we don't get a long list of processes 15 00:00:52,966 --> 00:00:54,533 which happen in the background, 16 00:00:54,733 --> 00:01:02,566 let's use '-fsSL' flag to keep our result as small as OK. 17 00:01:02,566 --> 00:01:06,965 And it shows OK, which means we got our gpg key. 18 00:01:07,233 --> 00:01:12,066 Let's verify this key using 'sudo apt-key fingerprint' command. 19 00:01:12,166 --> 00:01:16,000 We can verify that we have received the correct key by searching 20 00:01:16,000 --> 00:01:19,866 for the last eight characters of the fingerprint, which should 21 00:01:19,866 --> 00:01:23,766 be '0EBF CD88'. 22 00:01:24,500 --> 00:01:27,766 This information is provided by Docker itself, 23 00:01:27,766 --> 00:01:30,533 so there is not much for you to figure out. 24 00:01:30,533 --> 00:01:37,233 And yes, our key does have those characters as its last 8 digits. 25 00:01:37,233 --> 00:01:41,933 Now, run this command to add a repository called stable 26 00:01:41,933 --> 00:01:49,933 and add the content of 'download.docker.com/linux/ubuntu' on it. 27 00:01:50,533 --> 00:01:55,666 We have provided the flag 'lsb_release -cs' 28 00:01:55,666 --> 00:02:00,433 to make sure that Docker provides correct files, which means files 29 00:02:00,433 --> 00:02:05,433 for Ubuntu Xenial or Ubuntu 16.4 to our stable repository. 30 00:02:05,433 --> 00:02:07,200 [No Audio] 31 00:02:07,233 --> 00:02:10,800 Let's run the update again to reflect the changes. 32 00:02:10,800 --> 00:02:12,833 [No Audio] 33 00:02:12,833 --> 00:02:18,766 Run 'sudo apt-get install docker-ce' to finally install Docker 34 00:02:18,766 --> 00:02:22,700 '-ce' stands for Community Edition, which is one of 35 00:02:22,700 --> 00:02:25,133 the two editions provided by Docker. 36 00:02:25,266 --> 00:02:28,966 The other one is called the Enterprise Edition, which is 37 00:02:28,966 --> 00:02:32,766 not free, so we won't be including it in this course. 38 00:02:32,766 --> 00:02:37,166 [No Audio] 39 00:02:37,166 --> 00:02:40,533 The process has ended and we have successfully installed 40 00:02:40,533 --> 00:02:43,566 docker-ce or Docker Community Edition. 41 00:02:43,566 --> 00:02:45,400 [No Audio] 42 00:02:45,400 --> 00:02:48,166 Verify that our installation is successful, 43 00:02:48,166 --> 00:02:51,800 by running 'sudo docker run hello-world' Command. 44 00:02:51,800 --> 00:02:55,400 This will run a container called hello-world, which would 45 00:02:55,400 --> 00:02:58,900 only be possible if the Docker installation was successful. 46 00:02:59,166 --> 00:03:02,300 You don't have to pay much attention to the processes which 47 00:03:02,300 --> 00:03:05,533 are going on, because we will be exploring all of them 48 00:03:05,533 --> 00:03:08,133 in sufficient depth in further modules. 49 00:03:08,233 --> 00:03:12,400 As it says, our installation appears to be working correctly. 50 00:03:12,400 --> 00:03:15,900 You may have noticed that we have been using root privileges 51 00:03:15,900 --> 00:03:19,800 over and over, to make sure that you can run Docker from your 52 00:03:19,800 --> 00:03:21,333 regular user as well. 53 00:03:21,333 --> 00:03:23,433 Let's perform a few more steps. 54 00:03:23,566 --> 00:03:29,600 First, let's add a group called docker using 'sudo groupadd docker'. 55 00:03:29,600 --> 00:03:33,733 Now let's add a user which is dhwani to this docker group 56 00:03:33,733 --> 00:03:35,900 and provide it root privileges. 57 00:03:35,900 --> 00:03:39,533 Now let's try to run a hello-world container without root 58 00:03:39,533 --> 00:03:43,400 privileges with just docker run hello-world command 59 00:03:43,866 --> 00:03:45,433 and we get the same results.