sudo yum check-update
curl -fsSL https://get.docker.com/ | sh
sudo systemctl start docker
sudo systemctl status docker
sudo systemctl enable docker
sudo usermod -aG docker $(whoami)
安装完Docker以后,以普通用户执行如下命令:
sudo mkdir -p /etc/systemd/system/docker.service.d/
sudo cat << EOF > /etc/systemd/system/docker.service.d/docker.root.conf
[Service]
ExecStart=
ExecStart=/usr/bin/dockerd -g /data/docker -H fd://
EOF
sudo systemctl daemon-reload
sudo systemctl restart docker