从包安装,最简安装方式

  1. 更新yum yum update
  2. 转到 https://download.docker.com/linux/centos/7/x86_64/stable/Packages/ 并下载.rpm要安装的Docker版本的文件
  3. 安装Docker CE,将下面的路径更改为您下载Docker软件包的路径。
    # yum install /path/to/package.rpm
    eg:yum install https://yum.dockerproject.org/repo/main/centos/7/Packages/docker-engine-1.10.0-1.el7.centos.x86_64.rpm
    查看安装是否成功docker version,client启动成功
    docker安装成功
  4. 启动docker systemctl start docker
    查看启动成功docker version,client和service启动成功
    docker启动成功
    或者运行docker run hello-world 映像验证是否已正确安装
    docker启动成功
  5. 设置开机自启动 sudo systemctl enable docker
  6. 卸载docker
yum remove docker \
                  docker-client \
                  docker-client-latest \
                  docker-common \
                  docker-latest \
                  docker-latest-logrotate \
                  docker-logrotate \
                  docker-selinux \
                  docker-engine-selinux \
                  docker-engine

资料参考:https://docs.docker.com/install/linux/docker-ce/centos/#upgrade-docker-ce

Logo

权威|前沿|技术|干货|国内首个API全生命周期开发者社区

更多推荐