话不多说,直接上教程
#Centos7关闭防火墙命令
systemctl stop firewalld
#ubuntu关闭防火墙命令
ufw disable
##安装docker
#centos7安装
echo "nameserver 114.114.114.114" >> /etc/resolv.conf
systemctl restart network (如果命令失败则执行命令:service networking restart)
yum install upgrade(apt-get upgrade)
yum install -y wget(apt-get install -y wget)
wget –qO- https://get.docker.com
mv index.html installdocker.sh
sh installdocker.sh(如若异常,请输入命令:apt install docker.io)
#ubuntu安装
apt install docker.io -y
apt install docker-compose -y