yum下载docker安装包安装到离线机器的实例代码详解
1.在可联网机器上,使用默认centosyum源
[root@kole~]#pwd /root [root@kole~]# [root@kole~]#cddocker/ [root@koledocker]#yuminstall--downloadonly--downloaddir=/root/dockerdocker [root@koledocker]#ll total38800 -rw-r--r--1rootroot35780Oct200:52atomic-registries-1.22.1-25.git5a342e3.el7.centos.x86_64.rpm -rw-r--r--1rootroot36688Aug2203:48container-selinux-2.68-1.el7.noarch.rpm -rw-r--r--1rootroot35364Aug2203:48container-storage-setup-0.11.0-2.git5eaf76c.el7.noarch.rpm -rw-r--r--1rootroot17138052Oct200:52docker-1.13.1-75.git8633870.el7.centos.x86_64.rpm -rw-r--r--1rootroot4013036Oct200:52docker-client-1.13.1-75.git8633870.el7.centos.x86_64.rpm -rw-r--r--1rootroot95016Oct200:52docker-common-1.13.1-75.git8633870.el7.centos.x86_64.rpm -rw-r--r--1rootroot94468Sep2819:33libgudev1-219-57.el7_5.3.x86_64.rpm -rw-r--r--1rootroot165680Apr262018libselinux-2.5-12.el7.x86_64.rpm -rw-r--r--1rootroot240876Apr262018libselinux-python-2.5-12.el7.x86_64.rpm -rw-r--r--1rootroot154984Apr262018libselinux-utils-2.5-12.el7.x86_64.rpm -rw-r--r--1rootroot153596Apr252018libsemanage-2.5-11.el7.x86_64.rpm -rw-r--r--1rootroot114804Apr252018libsemanage-python-2.5-11.el7.x86_64.rpm -rw-r--r--1rootroot303736Apr252018libsepol-2.5-8.1.el7.x86_64.rpm -rw-r--r--1rootroot56068Jan302015libyaml-0.1.4-11.el7_0.x86_64.rpm -rw-r--r--1rootroot100668Apr252018lz4-1.7.5-2.el7.x86_64.rpm -rw-r--r--1rootroot1109112Mar92018oci-register-machine-0-6.git2b44233.el7.x86_64.rpm -rw-r--r--1rootroot33860Aug2203:48oci-systemd-hook-0.1.17-2.git83283a0.el7.x86_64.rpm -rw-r--r--1rootroot32440Mar92018oci-umount-2.3.3-3.gite3c9055.el7.x86_64.rpm -rw-r--r--1rootroot887548Apr252018policycoreutils-2.5-22.el7.x86_64.rpm -rw-r--r--1rootroot464972Apr252018policycoreutils-python-2.5-22.el7.x86_64.rpm -rw-r--r--1rootroot18692Nov292017python-pytoml-0.1.14-1.git7dea353.el7.noarch.rpm -rw-r--r--1rootroot156952Jul42014PyYAML-3.10-11.el7.x86_64.rpm -rw-r--r--1rootroot463888Aug2022:19selinux-policy-3.13.1-192.el7_5.6.noarch.rpm -rw-r--r--1rootroot6881288Aug2022:20selinux-policy-targeted-3.13.1-192.el7_5.6.noarch.rpm -rw-r--r--1rootroot634220Apr252018setools-libs-3.3.8-2.el7.x86_64.rpm -rw-r--r--1rootroot17100Jul1801:18skopeo-containers-0.1.31-1.dev.gitae64ff7.el7.centos.x86_64.rpm -rw-r--r--1rootroot200128Apr252018subscription-manager-rhsm-certificates-1.20.11-1.el7.centos.x86_64.rpm -rw-r--r--1rootroot5278020Sep2819:34systemd-219-57.el7_5.3.x86_64.rpm -rw-r--r--1rootroot411908Sep2819:34systemd-libs-219-57.el7_5.3.x86_64.rpm -rw-r--r--1rootroot131556Sep2819:34systemd-python-219-57.el7_5.3.x86_64.rpm -rw-r--r--1rootroot81520Sep2819:34systemd-sysv-219-57.el7_5.3.x86_64.rpm [root@koledocker]#createrepo. [root@kole~]#tar-czvfdocker.tar.gzdocker
2.离线机器安装docker
[root@koledocker]#tar-zxvfdocker.tar.gz [root@koledocker]#ll total36648 drwxr-xr-x3root04096Dec320:36docker -rw-r--r--1root037521067Dec320:15docker.tar.gz [root@koledocker]#cddocker/ [root@koledocker]#ll total8888800 -rw-r--r--1root035780Oct112:52atomic-registries-1.22.1-25.git5a342e3.el7.centos.x86_64.rpm -rw-r--r--1root09062522880Dec320:45centos7-base.tar -rw-r--r--1root036688Aug2115:48container-selinux-2.68-1.el7.noarch.rpm -rw-r--r--1root035364Aug2115:48container-storage-setup-0.11.0-2.git5eaf76c.el7.noarch.rpm -rw-r--r--1root017138052Oct112:52docker-1.13.1-75.git8633870.el7.centos.x86_64.rpm -rw-r--r--1root04013036Oct112:52docker-client-1.13.1-75.git8633870.el7.centos.x86_64.rpm -rw-r--r--1root095016Oct112:52docker-common-1.13.1-75.git8633870.el7.centos.x86_64.rpm -rw-r--r--1root094468Sep2807:33libgudev1-219-57.el7_5.3.x86_64.rpm -rw-r--r--1root0165680Apr262018libselinux-2.5-12.el7.x86_64.rpm -rw-r--r--1root0240876Apr262018libselinux-python-2.5-12.el7.x86_64.rpm -rw-r--r--1root0154984Apr262018libselinux-utils-2.5-12.el7.x86_64.rpm -rw-r--r--1root0153596Apr252018libsemanage-2.5-11.el7.x86_64.rpm -rw-r--r--1root0114804Apr252018libsemanage-python-2.5-11.el7.x86_64.rpm -rw-r--r--1root0303736Apr252018libsepol-2.5-8.1.el7.x86_64.rpm -rw-r--r--1root056068Jan292015libyaml-0.1.4-11.el7_0.x86_64.rpm -rw-r--r--1root0100668Apr252018lz4-1.7.5-2.el7.x86_64.rpm -rw-r--r--1root01109112Mar92018oci-register-machine-0-6.git2b44233.el7.x86_64.rpm -rw-r--r--1root033860Aug2115:48oci-systemd-hook-0.1.17-2.git83283a0.el7.x86_64.rpm -rw-r--r--1root032440Mar92018oci-umount-2.3.3-3.gite3c9055.el7.x86_64.rpm -rw-r--r--1root0887548Apr252018policycoreutils-2.5-22.el7.x86_64.rpm -rw-r--r--1root0464972Apr252018policycoreutils-python-2.5-22.el7.x86_64.rpm -rw-r--r--1root018692Nov282017python-pytoml-0.1.14-1.git7dea353.el7.noarch.rpm -rw-r--r--1root0156952Jul42014PyYAML-3.10-11.el7.x86_64.rpm drwxr-xr-x2root04096Dec304:54repodata -rw-r--r--1root0463888Aug2010:19selinux-policy-3.13.1-192.el7_5.6.noarch.rpm -rw-r--r--1root06881288Aug2010:20selinux-policy-targeted-3.13.1-192.el7_5.6.noarch.rpm -rw-r--r--1root0634220Apr252018setools-libs-3.3.8-2.el7.x86_64.rpm -rw-r--r--1root017100Jul1713:18skopeo-containers-0.1.31-1.dev.gitae64ff7.el7.centos.x86_64.rpm -rw-r--r--1root0200128Apr252018subscription-manager-rhsm-certificates-1.20.11-1.el7.centos.x86_64.rpm -rw-r--r--1root05278020Sep2807:34systemd-219-57.el7_5.3.x86_64.rpm -rw-r--r--1root0411908Sep2807:34systemd-libs-219-57.el7_5.3.x86_64.rpm -rw-r--r--1root0131556Sep2807:34systemd-python-219-57.el7_5.3.x86_64.rpm -rw-r--r--1root081520Sep2807:34systemd-sysv-219-57.el7_5.3.x86_64.rpm [root@koledocker]#cat/etc/yum.repos.d/local.repo [local] name=local baseurl=file:///mnt enabled=1 gpgcheck=0 [docker] name=docker baseurl=file:///root/docker/docker enabled=1 gpgcheck=0 [root@koledocker]#yuminstall-ydocker
总结
以上所述是小编给大家介绍的yum下载docker安装包安装到离线机器的实例代码详解,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对毛票票网站的支持!