2018
Oct
15

RHEL 7

直接用 yum 就可以安装 docker : sudo yum install docker

安装最新版 docker-ce

上面的安装方式,只会装到旧版 docker-1.7.x,如果想要最新版本的 docker 可以参考下面的指令:

编辑 /etc/yum.conf 加上 exclude=*.i386 *.i686

安装 docker-ce 与相关 packages
  1. sudo yum install -y docker-ce-18.09.0-3.el7.x86_64 http://mirror.centos.org/centos/7/extras/x86_64/Packages/container-selinux-2.74-1.el7.noarch.rpm http://mirror.centos.org/centos/7/os/x86_64/Packages/policycoreutils-2.5-29.el7.x86_64.rpm http://mirror.centos.org/centos/7/os/x86_64/Packages/libselinux-utils-2.5-14.1.el7.x86_64.rpm http://mirror.centos.org/centos/7/os/x86_64/Packages/libsemanage-2.5-14.el7.x86_64.rpm http://mirror.centos.org/centos/7/os/x86_64/Packages/libsepol-2.5-10.el7.x86_64.rpm http://mirror.centos.org/centos/7/os/x86_64/Packages/libselinux-2.5-14.1.el7.x86_64.rpm http://mirror.centos.org/centos/7/os/x86_64/Packages/policycoreutils-python-2.5-29.el7.x86_64.rpm http://mirror.centos.org/centos/7/os/x86_64/Packages/libsemanage-python-2.5-14.el7.x86_64.rpm http://mirror.centos.org/centos/7/os/x86_64/Packages/setools-libs-3.3.8-4.el7.x86_64.rpm http://mirror.centos.org/centos/7/updates/x86_64/Packages/selinux-policy-targeted-3.13.1-229.el7_6.6.noarch.rpm http://mirror.centos.org/centos/7/updates/x86_64/Packages/selinux-policy-3.13.1-229.el7_6.6.noarch.rpm http://mirror.centos.org/centos/7/os/x86_64/Packages/libselinux-devel-2.5-14.1.el7.x86_64.rpm http://mirror.centos.org/centos/7/os/x86_64/Packages/libsepol-devel-2.5-10.el7.x86_64.rpm http://mirror.centos.org/centos/7/os/x86_64/Packages/libselinux-python-2.5-14.1.el7.x86_64.rpm http://mirror.centos.org/centos/7/os/x86_64/Packages/libsepol-devel-2.5-10.el7.x86_64.rpm http://mirror.centos.org/centos/7/updates/x86_64/Packages/device-mapper-libs-1.02.149-10.el7_6.2.x86_64.rpm http://mirror.centos.org/centos/7/updates/x86_64/Packages/device-mapper-1.02.149-10.el7_6.2.x86_64.rpm http://mirror.centos.org/centos/7/updates/x86_64/Packages/device-mapper-event-1.02.149-10.el7_6.2.x86_64.rpm http://mirror.centos.org/centos/7/updates/x86_64/Packages/device-mapper-event-libs-1.02.149-10.el7_6.2.x86_64.rpm http://mirror.centos.org/centos/7/updates/x86_64/Packages/lvm2-libs-2.02.180-10.el7_6.2.x86_64.rpm http://mirror.centos.org/centos/7/updates/x86_64/Packages/lvm2-2.02.180-10.el7_6.2.x86_64.rpm http://mirror.centos.org/centos/7/os/x86_64/Packages/device-mapper-persistent-data-0.7.3-3.el7.x86_64.rpm

RHEL 6

先指定 docker yum repo

Example
  1. sudo tee /etc/yum.repos.d/docker.repo <<-EOF
  2. [dockerrepo]
  3. name=Docker Repository
  4. baseurl=https://yum.dockerproject.org/repo/main/centos/6
  5. enabled=1
  6. gpgcheck=1
  7. gpgkey=https://yum.dockerproject.org/gpg
  8. EOF

sudo yum install docker-engine


回應 (Leave a comment)