执行以下脚本即可:

curl -fsSL https://get.docker.com -o get-docker.sh
sh get-docker.sh

然后设置开机启动:

sudo systemctl enable docker

启动服务:

sudo systemctl start docker