使用官方安装脚本自动安装
安装命令:
curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun
也可以使用国内 daocloud 一键安装命令
curl -sSL https://get.daocloud.io/docker | sh
启动docker
systemctl start docker
设置开机启动
systemctl enable docker // 开启启动docker
sudo systemctl start docker && sudo systemctl enable docker // 启动并开机启动
查看docker 服务状态
systemctl status docker
docker 环境检查
docker info
docker 版本查看
docker version
docker-compose 安装
sudo curl -L "https://github.com/docker/compose/releases/download/{verstion}/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose // 给予执行权限