Blog Single
Install Docker without Network on RHEL 7.2

When your Linux has no internet connections.
docker-engine-1.12.3-1.el7.centos.x86_64.rpm
docker-engine-selinux-1.12.3-1.el7.centos.noarch.rpm

Step-by-step guide
  • 1. Upload the attached file to your Linux Server to /tmp
  • 2. install docker with yum:

yum install /tmp/docker-engine-1.12.3-1.el7.centos.x86_64.rpm /tmp/docker-engine-selinux-1.12.3-1.el7.centos.noarch.rpm
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Examining /tmp/docker-engine-1.12.3-1.el7.centos.x86_64.rpm: docker-engine-1.12.3-1.el7.centos.x86_64
Marking /tmp/docker-engine-1.12.3-1.el7.centos.x86_64.rpm to be installed
Examining /tmp/docker-engine-selinux-1.12.3-1.el7.centos.noarch.rpm: docker-engine-selinux-1.12.3-1.el7.centos.noarch
Marking /tmp/docker-engine-selinux-1.12.3-1.el7.centos.noarch.rpm to be installed

Resolving Dependencies

  Running transaction check

  Package docker-engine.x86_64 0:1.12.3-1.el7.centos will be installed

  Package docker-engine-selinux.noarch 0:1.12.3-1.el7.centos will be installed

  Finished Dependency Resolution

Dependencies Resolved

yum install /tmp/docker-engine-1.12.3-1.el7.centos.x86_64.rpm /tmp/docker-engine-selinux-1.12.3-1.el7.centos.noarch.rpm
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Examining /tmp/docker-engine-1.12.3-1.el7.centos.x86_64.rpm: docker-engine-1.12.3-1.el7.centos.x86_64
Marking /tmp/docker-engine-1.12.3-1.el7.centos.x86_64.rpm to be installed
Examining /tmp/docker-engine-selinux-1.12.3-1.el7.centos.noarch.rpm: docker-engine-selinux-1.12.3-1.el7.centos.noarch
Marking /tmp/docker-engine-selinux-1.12.3-1.el7.centos.noarch.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package docker-engine.x86_64 0:1.12.3-1.el7.centos will be installed
---> Package docker-engine-selinux.noarch 0:1.12.3-1.el7.centos will be installed
--> Finished Dependency Resolution
Dependencies Resolved
=====================================================================================================================================================================================================
 Package                                     Arch                         Version                                      Repository                                                               Size
=====================================================================================================================================================================================================
Installing:
 docker-engine                               x86_64                       1.12.3-1.el7.centos                          /docker-engine-1.12.3-1.el7.centos.x86_64                                79 M
 docker-engine-selinux                       noarch                       1.12.3-1.el7.centos                          /docker-engine-selinux-1.12.3-1.el7.centos.noarch                        43 k
Transaction Summary
=====================================================================================================================================================================================================
Install  2 Packages
Total size: 79 M
Installed size: 79 M
Is this ok [y/d/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : docker-engine-selinux-1.12.3-1.el7.centos.noarch                                                                                                                                  1/2
restorecon:  lstat(/var/lib/docker) failed:  No such file or directory
warning: %post(docker-engine-selinux-1.12.3-1.el7.centos.noarch) scriptlet failed, exit status 255
Non-fatal POSTIN scriptlet failure in rpm package docker-engine-selinux-1.12.3-1.el7.centos.noarch
  Installing : docker-engine-1.12.3-1.el7.centos.x86_64                                                                                                                                          2/2
  Verifying  : docker-engine-1.12.3-1.el7.centos.x86_64                                                                                                                                          1/2
  Verifying  : docker-engine-selinux-1.12.3-1.el7.centos.noarch                                                                                                                                  2/2
Installed:
  docker-engine.x86_64 0:1.12.3-1.el7.centos                                                    docker-engine-selinux.noarch 0:1.12.3-1.el7.centos
Complete!
[root@beihai ~]# docker --version
Docker version 1.12.3, build 6b644ec
Configure Docker Registry to OSM Docker private Registry :
vi /usr/lib/systemd/system/docker.service
[Unit]
Description=Docker Application Container Engine
Documentation=https://docs.docker.com
After=network.target
[Service]
Type=notify
# the default is not to use systemd for cgroups because the delegate issues still
# exists and systemd currently does not support the cgroup feature set required
# for containers run by docker
#ExecStart=/usr/bin/dockerd
ExecStart=/usr/bin/dockerd --insecure-registry=10.151.124.150:8089
ExecReload=/bin/kill -s HUP $MAINPID
# Having non-zero Limit*s causes performance problems due to accounting overhead
# in the kernel. We recommend using cgroups to do container-local accounting.
LimitNOFILE=infinity
LimitNPROC=infinity
LimitCORE=infinity
# Uncomment TasksMax if your systemd version supports it.
# Only systemd 226 and above support this version.
#TasksMax=infinity
TimeoutStartSec=0
# set delegate yes so that systemd does not reset the cgroups of docker containers
Delegate=yes
# kill only the docker process, not all processes in the cgroup
KillMode=process
[Install]
WantedBy=multi-user.target
:wq!
 
systemctl daemon-reload
service docker restart
Tags:
Share:
Comments
Write a comment
Your email address will not be published. Required fields are marked *
Review*
Name*
Email*
Notify me of new posts by email