Installing Docker from Git

To install docker community edition you can use git for a simple ant recent install. We are using CentOS but need a newer version of docker. The below steps can be used.

First install Git if you don’t have it

[root@localhost ~]# yum install git
....

Dependencies Resolved

=================================================================================================================================================
 Package                                    Arch                       Version                                 Repository                   Size
=================================================================================================================================================
Installing:
 git                                        x86_64                     1.8.3.1-12.el7_4                        updates                     4.4 M
Installing for dependencies:
 libgnome-keyring                           x86_64                     3.12.0-1.el7                            base                        109 k
 perl                                       x86_64                     4:5.16.3-292.el7                        base                        8.0 M
 perl-Carp                                  noarch                     1.26-244.el7                            base                         19 k
 perl-Encode                                x86_64                     2.51-7.el7                              base                        1.5 M
 perl-Error                                 noarch                     1:0.17020-2.el7                         base                         32 k
 perl-Exporter                              noarch                     5.68-3.el7                              base                         28 k
 perl-File-Path                             noarch                     2.09-2.el7                              base                         26 k
 perl-File-Temp                             noarch                     0.23.01-3.el7                           base                         56 k
 perl-Filter                                x86_64                     1.49-3.el7                              base                         76 k
 perl-Getopt-Long                           noarch                     2.40-2.el7                              base                         56 k
 perl-Git                                   noarch                     1.8.3.1-12.el7_4                        updates                      53 k
 perl-HTTP-Tiny                             noarch                     0.033-3.el7                             base                         38 k
 perl-PathTools                             x86_64                     3.40-5.el7                              base                         82 k
 perl-Pod-Escapes                           noarch                     1:1.04-292.el7                          base                         51 k
 perl-Pod-Perldoc                           noarch                     3.20-4.el7                              base                         87 k
 perl-Pod-Simple                            noarch                     1:3.28-4.el7                            base                        216 k
 perl-Pod-Usage                             noarch                     1.63-3.el7                              base                         27 k
 perl-Scalar-List-Utils                     x86_64                     1.27-248.el7                            base                         36 k
 perl-Socket                                x86_64                     2.010-4.el7                             base                         49 k
 perl-Storable                              x86_64                     2.45-3.el7                              base                         77 k
 perl-TermReadKey                           x86_64                     2.30-20.el7                             base                         31 k
 perl-Text-ParseWords                       noarch                     3.29-4.el7                              base                         14 k
 perl-Time-HiRes                            x86_64                     4:1.9725-3.el7                          base                         45 k
 perl-Time-Local                            noarch                     1.2300-2.el7                            base                         24 k
 perl-constant                              noarch                     1.27-2.el7                              base                         19 k
 perl-libs                                  x86_64                     4:5.16.3-292.el7                        base                        688 k
 perl-macros                                x86_64                     4:5.16.3-292.el7                        base                         43 k
 perl-parent                                noarch                     1:0.225-244.el7                         base                         12 k
 perl-podlators                             noarch                     2.5.1-3.el7                             base                        112 k
 perl-threads                               x86_64                     1.87-4.el7                              base                         49 k
 perl-threads-shared                        x86_64                     1.43-6.el7                              base                         39 k
 rsync                                      x86_64                     3.0.9-18.el7                            base                        360 k

Transaction Summary
=================================================================================================================================================
Install  1 Package (+32 Dependent packages)

.....

Complete!

Now you can clone a copy of the docker install from github

[root@localhost ~]# git clone https://github.com/docker/docker-install.git
Cloning into 'docker-install'...
remote: Counting objects: 518, done.
remote: Total 518 (delta 0), reused 0 (delta 0), pack-reused 518
Receiving objects: 100% (518/518), 184.60 KiB | 0 bytes/s, done.
Resolving deltas: 100% (227/227), done.

Now you can navigate to the docker-install directory and perform an install. Check the README.md for more information if needed.

[root@localhost ~]# cd docker-install/
[root@localhost docker-install]# sh install.sh
# Executing docker install script, commit: UNKNOWN
+ sh -c 'yum install -y -q yum-utils'
+ sh -c 'yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo'
Loaded plugins: fastestmirror
adding repo from: https://download.docker.com/linux/centos/docker-ce.repo
grabbing file https://download.docker.com/linux/centos/docker-ce.repo to /etc/yum.repos.d/docker-ce.repo
repo saved to /etc/yum.repos.d/docker-ce.repo
+ '[' test '!=' stable ']'
+ sh -c 'yum-config-manager --enable docker-ce-test'
Loaded plugins: fastestmirror
============================================================= repo: docker-ce-test ==============================================================
[docker-ce-test]
async = True
bandwidth = 0
base_persistdir = /var/lib/yum/repos/x86_64/7
baseurl = https://download.docker.com/linux/centos/7/x86_64/test
cache = 0
cachedir = /var/cache/yum/x86_64/7/docker-ce-test
check_config_file_age = True
compare_providers_priority = 80
cost = 1000
deltarpm_metadata_percentage = 100
deltarpm_percentage =
enabled = 1
enablegroups = True
exclude =
failovermethod = priority
ftp_disable_epsv = False
gpgcadir = /var/lib/yum/repos/x86_64/7/docker-ce-test/gpgcadir
gpgcakey =
gpgcheck = True
gpgdir = /var/lib/yum/repos/x86_64/7/docker-ce-test/gpgdir
gpgkey = https://download.docker.com/linux/centos/gpg
hdrdir = /var/cache/yum/x86_64/7/docker-ce-test/headers
http_caching = all
includepkgs =
ip_resolve =
keepalive = True
keepcache = False
mddownloadpolicy = sqlite
mdpolicy = group:small
mediaid =
metadata_expire = 21600
metadata_expire_filter = read-only:present
metalink =
minrate = 0
mirrorlist =
mirrorlist_expire = 86400
name = Docker CE Test - x86_64
old_base_cache_dir =
password =
persistdir = /var/lib/yum/repos/x86_64/7/docker-ce-test
pkgdir = /var/cache/yum/x86_64/7/docker-ce-test/packages
proxy = False
proxy_dict =
proxy_password =
proxy_username =
repo_gpgcheck = False
retries = 10
skip_if_unavailable = False
ssl_check_cert_permissions = True
sslcacert =
sslclientcert =
sslclientkey =
sslverify = True
throttle = 0
timeout = 30.0
ui_id = docker-ce-test/x86_64
ui_repoid_vars = releasever,
   basearch
username =

+ sh -c 'yum makecache'
Loaded plugins: fastestmirror
base                                                                                                                      | 3.6 kB  00:00:00
docker-ce-stable                                                                                                          | 2.9 kB  00:00:00
docker-ce-test                                                                                                            | 2.9 kB  00:00:00
extras                                                                                                                    | 3.4 kB  00:00:00
updates                                                                                                                   | 3.4 kB  00:00:00
(1/14): docker-ce-stable/x86_64/primary_db                                                                                |  11 kB  00:00:00
(2/14): docker-ce-stable/x86_64/filelists_db                                                                              | 6.5 kB  00:00:00
(3/14): docker-ce-stable/x86_64/other_db                                                                                  |  65 kB  00:00:00
(4/14): docker-ce-test/x86_64/primary_db                                                                                  |  35 kB  00:00:00
(5/14): docker-ce-test/x86_64/filelists_db                                                                                |  18 kB  00:00:00
(6/14): docker-ce-test/x86_64/other_db                                                                                    | 145 kB  00:00:00
(7/14): extras/7/x86_64/prestodelta                                                                                       |  72 kB  00:00:00
(8/14): extras/7/x86_64/filelists_db                                                                                      | 528 kB  00:00:00
(9/14): extras/7/x86_64/other_db                                                                                          |  97 kB  00:00:00
(10/14): base/7/x86_64/other_db                                                                                           | 2.5 MB  00:00:01
(11/14): updates/7/x86_64/prestodelta                                                                                     | 646 kB  00:00:00
(12/14): updates/7/x86_64/other_db                                                                                        | 501 kB  00:00:00
(13/14): updates/7/x86_64/filelists_db                                                                                    | 3.0 MB  00:00:02
(14/14): base/7/x86_64/filelists_db                                                                                       | 6.7 MB  00:00:07
Loading mirror speeds from cached hostfile
 * base: centos-distro.cavecreek.net
 * extras: mirror.scalabledns.com
 * updates: centos.den.host-engine.com
Metadata Cache Created
+ sh -c 'yum install -y -q docker-ce'
warning: /var/cache/yum/x86_64/7/docker-ce-test/packages/docker-ce-18.01.0.ce-0.1.rc1.el7.centos.x86_64.rpm: Header V4 RSA/SHA512 Signature, key ID 621e9f35: NOKEY
Public key for docker-ce-18.01.0.ce-0.1.rc1.el7.centos.x86_64.rpm is not installed
Importing GPG key 0x621E9F35:
 Userid     : "Docker Release (CE rpm) "
 Fingerprint: 060a 61c5 1b55 8a7f 742b 77aa c52f eb6b 621e 9f35
 From       : https://download.docker.com/linux/centos/gpg
If you would like to use Docker as a non-root user, you should now consider
adding your user to the "docker" group with something like:

  sudo usermod -aG docker your-user

Remember that you will have to log out and back in for this to take effect!

WARNING: Adding a user to the "docker" group will grant the ability to run
         containers which can be used to obtain root privileges on the
         docker host.
         Refer to https://docs.docker.com/engine/security/security/#docker-daemon-attack-surface
         for more information.

Now you can see that it is installed and what version is installed. You may need to specify if you want a particular version, we just checked out whatever was available.

[root@localhost docker-install]# which docker
/usr/bin/docker
[root@localhost docker-install]# docker --version
Docker version 18.01.0-ce-rc1, build 44e2def