Hello, Linux Academy community! As we approach week three of the Linux Academy Docker associate certification group, I have had more and more people contact me about how to get started. My go-to answer has been, “Join Linux Academy, take our Docker quick start course, and then join our study group!”

However, my community is broader than just the students at Linux Academy, and as much as I would love to see all of you join, some of you may not be ready to take that step. One of my strengths, according to the Gallup Strengths assessment, is “Includer,” so it honestly pains me to think someone is being left out. That’s why this week I want to give everyone a starting place. How do you get started learning Docker? You install it, and you play with it!

This guide will walk you through installing Docker on an Ubuntu 16.04 server. However, you can find a similar guide for CentOS 7. 

Docker Install: Ubuntu

This demo was created using an Ubuntu cloud server.

If you are not running this install on Linux Academy, ensure that your kernel is running version 3.10 or higher by running the uname -r command:

[user@ellmarquez1 ~]$ uname -r
4.4.0-1063-aws

Setting up the Repository

  1. Ensure your apt package index is up to date:
    [user@ellmarquez1 ~]$ sudo apt-get update
  2. Install the following apt packages to allow apt to use a repository over HTTPS:
    [user@ellmarquez1 ~]$ sudo apt-get install \ apt-transport-https \ ca-certificates \ curl \ software-properties-common
  3. Add Docker’s official GPG key:
    [user@ellmarquez1 ~]$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
  4. Verify that the GPG key fingerprint matches. As of publishing this guide, the fingerprint is 9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88:
    [user@ellmarquez1 ~]$ 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
    
  5. Add the repository using the add-apt-repository command:
    [user@ellmarquez1 ~]$ sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"

Install Docker Community Edition

  1. Update the apt package index using the apt-get update command:
    [user@ellmarquez1 ~]$ sudo apt-get update
  2. Install Docker Community Edition using the apt-get install docker-ce command:
    [user@ellmarquez1 ~]$ sudo apt-get install docker-ce
  1. Confirm Docker installed correctly using the docker run command:
    [user@ellmarquez1 ~]$ sudo docker run hello-world

Optional

For best practices, do not use root. Instead, add your user to the Docker group. For this example, our user is named user:

[user@ellmarquez1 ~]$ sudo usermod -a -G docker user
[sudo] password for user:
[user@ellmarquez1 ~]$

Confirm the change using the grep command:

[user@ellmarquez1 ~]$  grep user /etc/group 
docker:x:999:user

Once finished, log out and then log back in for changes to take effect.

 

Need more ideas on what to do with your Docker environment? Take a look at our Docker Images Study Guide. 


Check out the latest Docker content we added in July!

Docker online training - new releases


Don’t let the cloud leave you behind. For a limited time save $150 on a yearly membership!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Get actionable training and tech advice

We'll email you our latest articles up to once per week.