- 安装
$ curl -fsSL https://get.docker.com -o get-docker.sh $ sh get-docker.sh
注: 这一步如果是CENTOS 8,可能会出现 requires containerd.io >= 1.2.2-3错误
-> 解决办法。
- 添加用户到用户组(需退出当前会话重启登录才生效)
gpasswd -a $USER docker
- 启动
systemctl start docker
- 设置docker开机自启动
systemctl enable docker
- 安装
docker-compose
$ curl -L "https://github.com/docker/compose/releases/download/1.24.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
$ chmod +x /usr/local/bin/docker-compose
$ ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose