centos7.3 安装docker

要安装Docker CE,您需要64位版本的CentOS 7

  • yum安装

依次执行以下命令,如有疑问请参考官方安装手册

[root@paascloud-test-001 ~]# yum remove docker docker-common docker-selinux docker-engine
[root@paascloud-test-001 ~]# yum install -y yum-utils device-mapper-persistent-data lvm2
[root@paascloud-test-001 ~]# yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
[root@paascloud-test-001 ~]# yum-config-manager --enable docker-ce-edge
[root@paascloud-test-001 ~]# yum-config-manager --enable docker-ce-test
[root@paascloud-test-001 ~]# yum-config-manager --disable docker-ce-edge
[root@paascloud-test-001 ~]# yum makecache fast
[root@paascloud-test-001 ~]# yum -y install docker-ce
[root@paascloud-test-001 ~]# systemctl start docker
[root@paascloud-test-001 ~]# docker run hello-world
[root@paascloud-test-001 ~]# docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
hello-world         latest              1815c82652c0        2 months ago        1.84kB
  • 本地安装

以上方案安装慢的让你想哭 从官方安装包中安装, 我这里安装版本docker-ce-17.06.0.ce-1.el7.centos.x86_64.rpm

[root@paascloud-test-001 ~]# yum install /usr/local/src/tool/docker-ce-17.06.0.ce-1.el7.centos.x86_64.rpm -y

Loaded plugins: fastestmirror
... 中间省略一万字                 
Complete!
  • 启动Docker。
[root@paascloud-test-001 ~]# systemctl start docker
  • 查看docker版本。
docker -v
Docker version 17.06.0-ce, build 02c1d87
  • 开机启动
[root@paascloud-test-001 ~]# systemctl enable docker
Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /usr/lib/systemd/system/docker.service.
上一篇:CentOS 6.8上安装 docker.io


下一篇:vue按需引入element Transfer 穿梭框