赞
踩
yum install -y yum-utils device-mapper-persistent-data lvm2
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
yum install docker-ce
- systemctl start docker #启动docker服务
- systemctl stop docker #关闭docker服务
curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun
curl -sSL https://get.daocloud.io/docker | sh
curl -L https://get.daocloud.io/docker/compose/releases/download/1.16.1/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
chmod a+x /usr/local/bin/docker-compose
docker-compose --version
如果报错docker-compose: command not found
设置软链接,设置快捷方式
sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
通过将用户添加到docker用户组可以将sudo去掉,命令如下
sudo groupadd docker #添加docker用户组
sudo gpasswd -a $USER docker #将登陆用户加入到docker用户组中
newgrp docker #更新用户组
https://blog.csdn.net/weixin_42170236/article/details/109316078
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。