centos快速安装docker

官方文档

https://docs.docker.com/install/linux/docker-ce/centos/

命令安装


$ sudo yum install -y yum-utils \
  device-mapper-persistent-data \
  lvm2

$ sudo yum-config-manager \
    --add-repo \
    https://download.docker.com/linux/centos/docker-ce.repo

$ sudo yum install docker-ce docker-ce-cli containerd.io

启动

$ sudo systemctl start docker
$ sudo docker images

开启Remote API

vim  /lib/systemd/system/docker.service 
ExecStart=/usr/bin/dockerd -H unix:///var/run/docker.sock -H tcp://0.0.0.0:5678