CentOS安装Docker并设置开机启动

  1. 删除旧版

    1
    sudo yum remove docker docker-common  docker-selinux  docker-engine
  2. 安装库

    1
    sudo yum install -y yum-utils  device-mapper-persistent-data  lvm2
  3. 配置stable repo

    1
    sudo yum-config-manager --add-repo  https://download.docker.com/linux/centos/docker-ce.repo
  4. 安装

    1
    sudo yum install docker-ce
  5. 启动

    1
    sudo systemctl start docker
  6. 开机启动

    1
    sudo systemctl enable docker

7 . hello world

1
sudo docker run hello-world

Thanks for reading.