美文网首页
Centos 7.X 安装Docker

Centos 7.X 安装Docker

作者: 无罪的坏人 | 来源:发表于2019-08-28 20:54 被阅读0次

    感谢博客园大佬的分享https://www.cnblogs.com/yufeng218/p/8370670.html

    1.查看系统内核版本号

    Docker 要求 CentOS 系统的内核版本高于 3.10 ,其实Centos 7.0对应的内核版本就是3.10.0-123.el7.x86_64
    ,我们忽略这一步也是可以的。

    [root@centos7 ~]# uname -a
    Linux centos7.0-x64-3.10.0-123 3.10.0-123.el7.x86_64 #1 SMP Mon Jun 30 12:09:22 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
    [root@centos7 ~]# uname -r
    3.10.0-123.el7.x86_64
    

    2.更新yum

    [root@centos7 ~]# sudo yum update
    Loaded plugins: fastestmirror
    Loading mirror speeds from cached hostfile
     * base: mirrors.njupt.edu.cn
     * extras: mirrors.zju.edu.cn
     * updates: mirrors.zju.edu.cn
    Resolving Dependencies
    --> Running transaction check
    ---> Package ModemManager-glib.x86_64 0:1.1.0-6.git20130913.el7 will be updated
    ---> Package ModemManager-glib.x86_64 0:1.6.10-1.el7 will be an update
    ---> Package NetworkManager.x86_64 1:0.9.9.1-13.git20140326.4dba720.el7 will be obsoleted
    ---> Package NetworkManager.x86_64 1:1.12.0-10.el7_6 will be obsoleting
    --> Processing Dependency: NetworkManager-libnm(x86-64) = 1:1.12.0-10.el7_6 for package: 1:NetworkManager-1.12.0-10.el7_6.x86_64
    --> Processing Dependency: libnm.so.0(libnm_1_8_0)(64bit) for package: 1:NetworkManager-1.12.0-10.el7_6.x86_64
    --> Processing Dependency: libnm.so.0(libnm_1_6_0)(64bit) for package: 1:NetworkManager-1.12.0-10.el7_6.x86_64
    --> Processing Dependency: libnm.so.0(libnm_1_4_0)(64bit) for package: 1:NetworkManager-1.12.0-10.el7_6.x86_64
    --> Processing Dependency: libnm.so.0(libnm_1_2_0)(64bit) for package: 1:NetworkManager-1.12.0-10.el7_6.x86_64
    --> Processing Dependency: libnm.so.0(libnm_1_12_0)(64bit) for package: 1:NetworkManager-1.12.0-10.el7_6.x86_64
    --> Processing Dependency: libnm.so.0(libnm_1_10_2)(64bit) for package: 1:NetworkManager-1.12.0-10.el7_6.x86_64
    --> Processing Dependency: libnm.so.0(libnm_1_10_0)(64bit) for package: 1:NetworkManager-1.12.0-10.el7_6.x86_64
    ...................................................................中间省略.....................................................................................
    sqlite.x86_64 0:3.7.17-8.el7                                       sudo.x86_64 0:1.8.23-3.el7
      systemd.x86_64 0:219-62.el7_6.7                                    systemd-libs.x86_64 0:219-62.el7_6.7
      systemd-sysv.x86_64 0:219-62.el7_6.7                               tar.x86_64 2:1.26-35.el7
      teamd.x86_64 0:1.27-6.el7_6.1                                      tuned.noarch 0:2.10.0-6.el7_6.3
      tzdata.noarch 0:2019b-1.el7                                        util-linux.x86_64 0:2.23.2-59.el7_6.1
      vim-minimal.x86_64 2:7.4.160-6.el7_6                               virt-what.x86_64 0:1.18-4.el7
      wpa_supplicant.x86_64 1:2.6-12.el7                                 xfsprogs.x86_64 0:4.5.0-19.el7_6
      xz.x86_64 0:5.2.2-1.el7                                            xz-libs.x86_64 0:5.2.2-1.el7
      yum.noarch 0:3.4.3-161.el7.centos                                  yum-plugin-fastestmirror.noarch 0:1.1.31-50.el7
      zlib.x86_64 0:1.2.7-18.el7
    
    Replaced:
      NetworkManager.x86_64 1:0.9.9.1-13.git20140326.4dba720.el7        grub2.x86_64 1:2.02-0.2.10.el7.centos.1
      grub2-tools.x86_64 1:2.02-0.2.10.el7.centos.1                     libertas-sd8686-firmware.noarch 0:20140213-0.3.git4164c23.el7
      libertas-sd8787-firmware.noarch 0:20140213-0.3.git4164c23.el7     libertas-usb8388-firmware.noarch 2:20140213-0.3.git4164c23.el7
      pygobject3-base.x86_64 0:3.8.2-4.el7
    
    Complete!
    

    看到Complete即可,这需要一点时间,因网络情况而定

    3.卸载旧版本(如果安装过旧版本的话,我这里是没安装的)

    [root@centos7 ~]# sudo yum remove docker  docker-common docker-selinux docker-engine
    Loaded plugins: fastestmirror
    No Match for argument: docker
    No Match for argument: docker-common
    No Match for argument: docker-selinux
    No Match for argument: docker-engine
    No Packages marked for removal
    

    4.安装需要的软件包, yum-util 提供yum-config-manager功能,另外两个是devicemapper驱动依赖的

    [root@centos7 ~]# sudo yum install -y yum-utils device-mapper-persistent-data lvm2
    Loaded plugins: fastestmirror
    Loading mirror speeds from cached hostfile
     * base: mirrors.zju.edu.cn
     * extras: centos.ustc.edu.cn
     * updates: centos.ustc.edu.cn
    Package device-mapper-persistent-data-0.7.3-3.el7.x86_64 already installed and latest version
    Package 7:lvm2-2.02.180-10.el7_6.8.x86_64 already installed and latest version
    Resolving Dependencies
    --> Running transaction check
    ---> Package yum-utils.noarch 0:1.1.31-50.el7 will be installed
    --> Processing Dependency: python-kitchen for package: yum-utils-1.1.31-50.el7.noarch
    --> Processing Dependency: libxml2-python for package: yum-utils-1.1.31-50.el7.noarch
    --> Running transaction check
    ---> Package libxml2-python.x86_64 0:2.9.1-6.el7_2.3 will be installed
    ---> Package python-kitchen.noarch 0:1.1.1-5.el7 will be installed
    --> Processing Dependency: python-chardet for package: python-kitchen-1.1.1-5.el7.noarch
    --> Running transaction check
    ---> Package python-chardet.noarch 0:2.2.1-1.el7_1 will be installed
    --> Finished Dependency Resolution
    
    Dependencies Resolved
    
    =======================================================================================================================================
     Package                             Arch                        Version                               Repository                 Size
    =======================================================================================================================================
    Installing:
     yum-utils                           noarch                      1.1.31-50.el7                         base                      121 k
    Installing for dependencies:
     libxml2-python                      x86_64                      2.9.1-6.el7_2.3                       base                      247 k
     python-chardet                      noarch                      2.2.1-1.el7_1                         base                      227 k
     python-kitchen                      noarch                      1.1.1-5.el7                           base                      267 k
    
    Transaction Summary
    =======================================================================================================================================
    Install  1 Package (+3 Dependent packages)
    
    Total download size: 861 k
    Installed size: 4.3 M
    Downloading packages:
    (1/4): libxml2-python-2.9.1-6.el7_2.3.x86_64.rpm                                                                | 247 kB  00:00:00
    (2/4): python-kitchen-1.1.1-5.el7.noarch.rpm                                                                    | 267 kB  00:00:00
    (3/4): python-chardet-2.2.1-1.el7_1.noarch.rpm                                                                  | 227 kB  00:00:15
    (4/4): yum-utils-1.1.31-50.el7.noarch.rpm                                                                       | 121 kB  00:00:15
    ---------------------------------------------------------------------------------------------------------------------------------------
    Total                                                                                                   55 kB/s | 861 kB  00:00:15
    Running transaction check
    Running transaction test
    Transaction test succeeded
    Running transaction
      Installing : python-chardet-2.2.1-1.el7_1.noarch                                                                                 1/4
      Installing : python-kitchen-1.1.1-5.el7.noarch                                                                                   2/4
      Installing : libxml2-python-2.9.1-6.el7_2.3.x86_64                                                                               3/4
      Installing : yum-utils-1.1.31-50.el7.noarch                                                                                      4/4
      Verifying  : libxml2-python-2.9.1-6.el7_2.3.x86_64                                                                               1/4
      Verifying  : python-kitchen-1.1.1-5.el7.noarch                                                                                   2/4
      Verifying  : yum-utils-1.1.31-50.el7.noarch                                                                                      3/4
      Verifying  : python-chardet-2.2.1-1.el7_1.noarch                                                                                 4/4
    
    Installed:
      yum-utils.noarch 0:1.1.31-50.el7
    
    Dependency Installed:
      libxml2-python.x86_64 0:2.9.1-6.el7_2.3       python-chardet.noarch 0:2.2.1-1.el7_1       python-kitchen.noarch 0:1.1.1-5.el7
    
    Complete!
    

    和上面一样,看到Complete就好

    5.设置yum源(这一步比较关键,我们设置阿里的源)

    [root@centos7 ~]# sudo yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
    Loaded plugins: fastestmirror
    adding repo from: http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
    grabbing file http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo to /etc/yum.repos.d/docker-ce.repo
    repo saved to /etc/yum.repos.d/docker-ce.repo
    

    6.可以查看所有仓库中所有docker版本,并选择特定版本安装

    [root@centos7 ~]# yum list docker-ce --showduplicates | sort -r
     * updates: centos.ustc.edu.cn
    Loading mirror speeds from cached hostfile
    Loaded plugins: fastestmirror
     * extras: centos.ustc.edu.cn
    docker-ce.x86_64            3:19.03.1-3.el7                     docker-ce-stable
    docker-ce.x86_64            3:19.03.0-3.el7                     docker-ce-stable
    docker-ce.x86_64            3:18.09.8-3.el7                     docker-ce-stable
    docker-ce.x86_64            3:18.09.7-3.el7                     docker-ce-stable
    docker-ce.x86_64            3:18.09.6-3.el7                     docker-ce-stable
    docker-ce.x86_64            3:18.09.5-3.el7                     docker-ce-stable
    docker-ce.x86_64            3:18.09.4-3.el7                     docker-ce-stable
    docker-ce.x86_64            3:18.09.3-3.el7                     docker-ce-stable
    docker-ce.x86_64            3:18.09.2-3.el7                     docker-ce-stable
    docker-ce.x86_64            3:18.09.1-3.el7                     docker-ce-stable
    docker-ce.x86_64            3:18.09.0-3.el7                     docker-ce-stable
    docker-ce.x86_64            18.06.3.ce-3.el7                    docker-ce-stable
    docker-ce.x86_64            18.06.2.ce-3.el7                    docker-ce-stable
    docker-ce.x86_64            18.06.1.ce-3.el7                    docker-ce-stable
    docker-ce.x86_64            18.06.0.ce-3.el7                    docker-ce-stable
    docker-ce.x86_64            18.03.1.ce-1.el7.centos             docker-ce-stable
    docker-ce.x86_64            18.03.0.ce-1.el7.centos             docker-ce-stable
    docker-ce.x86_64            17.12.1.ce-1.el7.centos             docker-ce-stable
    docker-ce.x86_64            17.12.0.ce-1.el7.centos             docker-ce-stable
    docker-ce.x86_64            17.09.1.ce-1.el7.centos             docker-ce-stable
    docker-ce.x86_64            17.09.0.ce-1.el7.centos             docker-ce-stable
    docker-ce.x86_64            17.06.2.ce-1.el7.centos             docker-ce-stable
    docker-ce.x86_64            17.06.1.ce-1.el7.centos             docker-ce-stable
    docker-ce.x86_64            17.06.0.ce-1.el7.centos             docker-ce-stable
    docker-ce.x86_64            17.03.3.ce-1.el7                    docker-ce-stable
    docker-ce.x86_64            17.03.2.ce-1.el7.centos             docker-ce-stable
    docker-ce.x86_64            17.03.1.ce-1.el7.centos             docker-ce-stable
    docker-ce.x86_64            17.03.0.ce-1.el7.centos             docker-ce-stable
     * base: centos.ustc.edu.cn
    Available Packages
    

    7.安装docker(可以直接安装最新的,也可以安装指定的版本)

    [root@centos7 ~]# sudo yum install docker-ce
    Loaded plugins: fastestmirror
    Loading mirror speeds from cached hostfile
     * base: mirrors.zju.edu.cn
     * extras: centos.ustc.edu.cn
     * updates: centos.ustc.edu.cn
    Resolving Dependencies
    --> Running transaction check
    ---> Package docker-ce.x86_64 3:19.03.1-3.el7 will be installed
    --> Processing Dependency: container-selinux >= 2:2.74 for package: 3:docker-ce-19.03.1-3.el7.x86_64
    --> Processing Dependency: containerd.io >= 1.2.2-3 for package: 3:docker-ce-19.03.1-3.el7.x86_64
    --> Processing Dependency: libseccomp >= 2.3 for package: 3:docker-ce-19.03.1-3.el7.x86_64
    --> Processing Dependency: docker-ce-cli for package: 3:docker-ce-19.03.1-3.el7.x86_64
    --> Processing Dependency: libcgroup for package: 3:docker-ce-19.03.1-3.el7.x86_64
    --> Processing Dependency: libseccomp.so.2()(64bit) for package: 3:docker-ce-19.03.1-3.el7.x86_64
    --> Running transaction check
    ---> Package container-selinux.noarch 2:2.107-1.el7_6 will be installed
    --> Processing Dependency: policycoreutils-python for package: 2:container-selinux-2.107-1.el7_6.noarch
    ---> Package containerd.io.x86_64 0:1.2.6-3.3.el7 will be installed
    ---> Package docker-ce-cli.x86_64 1:19.03.1-3.el7 will be installed
    ---> Package libcgroup.x86_64 0:0.41-20.el7 will be installed
    ---> Package libseccomp.x86_64 0:2.3.1-3.el7 will be installed
    --> Running transaction check
    ---> Package policycoreutils-python.x86_64 0:2.5-29.el7_6.1 will be installed
    --> Processing Dependency: setools-libs >= 3.3.8-4 for package: policycoreutils-python-2.5-29.el7_6.1.x86_64
    --> Processing Dependency: libsemanage-python >= 2.5-14 for package: policycoreutils-python-2.5-29.el7_6.1.x86_64
    --> Processing Dependency: audit-libs-python >= 2.1.3-4 for package: policycoreutils-python-2.5-29.el7_6.1.x86_64
    --> Processing Dependency: python-IPy for package: policycoreutils-python-2.5-29.el7_6.1.x86_64
    --> Processing Dependency: libqpol.so.1(VERS_1.4)(64bit) for package: policycoreutils-python-2.5-29.el7_6.1.x86_64
    --> Processing Dependency: libqpol.so.1(VERS_1.2)(64bit) for package: policycoreutils-python-2.5-29.el7_6.1.x86_64
    --> Processing Dependency: libapol.so.4(VERS_4.0)(64bit) for package: policycoreutils-python-2.5-29.el7_6.1.x86_64
    --> Processing Dependency: checkpolicy for package: policycoreutils-python-2.5-29.el7_6.1.x86_64
    --> Processing Dependency: libqpol.so.1()(64bit) for package: policycoreutils-python-2.5-29.el7_6.1.x86_64
    --> Processing Dependency: libapol.so.4()(64bit) for package: policycoreutils-python-2.5-29.el7_6.1.x86_64
    --> Running transaction check
    ---> Package audit-libs-python.x86_64 0:2.8.4-4.el7 will be installed
    ---> Package checkpolicy.x86_64 0:2.5-8.el7 will be installed
    ---> Package libsemanage-python.x86_64 0:2.5-14.el7 will be installed
    ---> Package python-IPy.noarch 0:0.75-6.el7 will be installed
    ---> Package setools-libs.x86_64 0:3.3.8-4.el7 will be installed
    --> Finished Dependency Resolution
    
    Dependencies Resolved
    
    =======================================================================================================================================
     Package                                Arch                   Version                          Repository                        Size
    =======================================================================================================================================
    Installing:
     docker-ce                              x86_64                 3:19.03.1-3.el7                  docker-ce-stable                  24 M
    Installing for dependencies:
     audit-libs-python                      x86_64                 2.8.4-4.el7                      base                              76 k
     checkpolicy                            x86_64                 2.5-8.el7                        base                             295 k
     container-selinux                      noarch                 2:2.107-1.el7_6                  extras                            39 k
     containerd.io                          x86_64                 1.2.6-3.3.el7                    docker-ce-stable                  26 M
     docker-ce-cli                          x86_64                 1:19.03.1-3.el7                  docker-ce-stable                  39 M
     libcgroup                              x86_64                 0.41-20.el7                      base                              66 k
     libseccomp                             x86_64                 2.3.1-3.el7                      base                              56 k
     libsemanage-python                     x86_64                 2.5-14.el7                       base                             113 k
     policycoreutils-python                 x86_64                 2.5-29.el7_6.1                   updates                          456 k
     python-IPy                             noarch                 0.75-6.el7                       base                              32 k
     setools-libs                           x86_64                 3.3.8-4.el7                      base                             620 k
    
    Transaction Summary
    =======================================================================================================================================
    Install  1 Package (+11 Dependent packages)
    
    Total download size: 91 M
    Installed size: 374 M
    Is this ok [y/d/N]: y
    Downloading packages:
    (1/12): container-selinux-2.107-1.el7_6.noarch.rpm                                                              |  39 kB  00:00:00
    (2/12): audit-libs-python-2.8.4-4.el7.x86_64.rpm                                                                |  76 kB  00:00:00
    warning: /var/cache/yum/x86_64/7/docker-ce-stable/packages/docker-ce-19.03.1-3.el7.x86_64.rpm: Header V4 RSA/SHA512 Signature, key ID 621e9f35: NOKEY
    Public key for docker-ce-19.03.1-3.el7.x86_64.rpm is not installed
    (3/12): docker-ce-19.03.1-3.el7.x86_64.rpm                                                                      |  24 MB  00:00:02
    (4/12): libseccomp-2.3.1-3.el7.x86_64.rpm                                                                       |  56 kB  00:00:00
    (5/12): libsemanage-python-2.5-14.el7.x86_64.rpm                                                                | 113 kB  00:00:00
    (6/12): docker-ce-cli-19.03.1-3.el7.x86_64.rpm                                                                  |  39 MB  00:00:04
    (7/12): containerd.io-1.2.6-3.3.el7.x86_64.rpm                                                                  |  26 MB  00:00:07
    (8/12): python-IPy-0.75-6.el7.noarch.rpm                                                                        |  32 kB  00:00:00
    (9/12): setools-libs-3.3.8-4.el7.x86_64.rpm                                                                     | 620 kB  00:00:00
    (10/12): libcgroup-0.41-20.el7.x86_64.rpm                                                                       |  66 kB  00:00:05
    (11/12): checkpolicy-2.5-8.el7.x86_64.rpm                                                                       | 295 kB  00:00:15
    (12/12): policycoreutils-python-2.5-29.el7_6.1.x86_64.rpm                                                       | 456 kB  00:00:15
    ---------------------------------------------------------------------------------------------------------------------------------------
    Total                                                                                                  4.8 MB/s |  91 MB  00:00:19
    Retrieving key from https://mirrors.aliyun.com/docker-ce/linux/centos/gpg
    Importing GPG key 0x621E9F35:
     Userid     : "Docker Release (CE rpm) <docker@docker.com>"
     Fingerprint: 060a 61c5 1b55 8a7f 742b 77aa c52f eb6b 621e 9f35
     From       : https://mirrors.aliyun.com/docker-ce/linux/centos/gpg
    Is this ok [y/N]: y
    Running transaction check
    Running transaction test
    Transaction test succeeded
    Running transaction
      Installing : libcgroup-0.41-20.el7.x86_64                                                                                       1/12
      Installing : setools-libs-3.3.8-4.el7.x86_64                                                                                    2/12
      Installing : 1:docker-ce-cli-19.03.1-3.el7.x86_64                                                                               3/12
      Installing : libseccomp-2.3.1-3.el7.x86_64                                                                                      4/12
      Installing : libsemanage-python-2.5-14.el7.x86_64                                                                               5/12
      Installing : audit-libs-python-2.8.4-4.el7.x86_64                                                                               6/12
      Installing : python-IPy-0.75-6.el7.noarch                                                                                       7/12
      Installing : checkpolicy-2.5-8.el7.x86_64                                                                                       8/12
      Installing : policycoreutils-python-2.5-29.el7_6.1.x86_64                                                                       9/12
      Installing : 2:container-selinux-2.107-1.el7_6.noarch                                                                          10/12
      Installing : containerd.io-1.2.6-3.3.el7.x86_64                                                                                11/12
      Installing : 3:docker-ce-19.03.1-3.el7.x86_64                                                                                  12/12
      Verifying  : libcgroup-0.41-20.el7.x86_64                                                                                       1/12
      Verifying  : checkpolicy-2.5-8.el7.x86_64                                                                                       2/12
      Verifying  : policycoreutils-python-2.5-29.el7_6.1.x86_64                                                                       3/12
      Verifying  : python-IPy-0.75-6.el7.noarch                                                                                       4/12
      Verifying  : audit-libs-python-2.8.4-4.el7.x86_64                                                                               5/12
      Verifying  : libsemanage-python-2.5-14.el7.x86_64                                                                               6/12
      Verifying  : 2:container-selinux-2.107-1.el7_6.noarch                                                                           7/12
      Verifying  : libseccomp-2.3.1-3.el7.x86_64                                                                                      8/12
      Verifying  : containerd.io-1.2.6-3.3.el7.x86_64                                                                                 9/12
      Verifying  : 1:docker-ce-cli-19.03.1-3.el7.x86_64                                                                              10/12
      Verifying  : 3:docker-ce-19.03.1-3.el7.x86_64                                                                                  11/12
      Verifying  : setools-libs-3.3.8-4.el7.x86_64                                                                                   12/12
    
    Installed:
      docker-ce.x86_64 3:19.03.1-3.el7
    
    Dependency Installed:
      audit-libs-python.x86_64 0:2.8.4-4.el7    checkpolicy.x86_64 0:2.5-8.el7            container-selinux.noarch 2:2.107-1.el7_6
      containerd.io.x86_64 0:1.2.6-3.3.el7      docker-ce-cli.x86_64 1:19.03.1-3.el7      libcgroup.x86_64 0:0.41-20.el7
      libseccomp.x86_64 0:2.3.1-3.el7           libsemanage-python.x86_64 0:2.5-14.el7    policycoreutils-python.x86_64 0:2.5-29.el7_6.1
      python-IPy.noarch 0:0.75-6.el7            setools-libs.x86_64 0:3.3.8-4.el7
    
    Complete!
    

    或者指定安装版本

    [root@centos7 ~]# sudo yum install docker-ce-17.12.0.ce
    

    8.启动并加入开机启动

    [root@centos7 ~]# sudo systemctl start docker
    [root@centos7 ~]# sudo systemctl enable docker
    Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /usr/lib/systemd/system/docker.service.
    

    9.验证安装是否成功(有client和service两部分表示docker安装启动都成功了)

    [root@centos7 ~]# docker version
    Client: Docker Engine - Community
     Version:           19.03.1
     API version:       1.40
     Go version:        go1.12.5
     Git commit:        74b1e89
     Built:             Thu Jul 25 21:21:07 2019
     OS/Arch:           linux/amd64
     Experimental:      false
    
    Server: Docker Engine - Community
     Engine:
      Version:          19.03.1
      API version:      1.40 (minimum version 1.12)
      Go version:       go1.12.5
      Git commit:       74b1e89
      Built:            Thu Jul 25 21:19:36 2019
      OS/Arch:          linux/amd64
      Experimental:     false
     containerd:
      Version:          1.2.6
      GitCommit:        894b81a4b802e4eb2a91d1ce216b8817763c29fb
     runc:
      Version:          1.0.0-rc8
      GitCommit:        425e105d5a03fabd737a126ad93d62a9eeede87f
     docker-init:
      Version:          0.18.0
      GitCommit:        fec3683
    

    另外也可以这样验证

    [root@centos7 ~]# docker pull library/hello-world
    Using default tag: latest
    latest: Pulling from library/hello-world
    1b930d010525: Pull complete
    Digest: sha256:451ce787d12369c5df2a32c85e5a03d52cbcef6eb3586dd03075f3034f10adcd
    Status: Downloaded newer image for hello-world:latest
    docker.io/library/hello-world:latest
    [root@centos7 ~]# docker images
    REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
    hello-world         latest              fce289e99eb9        7 months ago        1.84kB
    [root@centos7 ~]# docker run hello-world
    
    Hello from Docker!
    This message shows that your installation appears to be working correctly.
    
    To generate this message, Docker took the following steps:
     1. The Docker client contacted the Docker daemon.
     2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
        (amd64)
     3. The Docker daemon created a new container from that image which runs the
        executable that produces the output you are currently reading.
     4. The Docker daemon streamed that output to the Docker client, which sent it
        to your terminal.
    
    To try something more ambitious, you can run an Ubuntu container with:
     $ docker run -it ubuntu bash
    
    Share images, automate workflows, and more with a free Docker ID:
     https://hub.docker.com/
    
    For more examples and ideas, visit:
     https://docs.docker.com/get-started/
    

    去拉一个文件看看,拉下来执行一把,如果能拉,并能执行,docker安装肯定没问题。

    相关文章

      网友评论

          本文标题:Centos 7.X 安装Docker

          本文链接:https://www.haomeiwen.com/subject/fufvectx.html