Centos7安装Docker
配置宿主机网卡转发
## 配置网卡转发,看值是否为1
$ sysctl -a |grep -w net.ipv4.ip_forward
net.ipv4.ip_forward = 1
## 若未配置,需要执行如下
$ cat <<EOF > /etc/sysctl.d/docker.conf
net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1
net.ipv4.ip_forward=1
EOF
$ sysctl -p /etc/sysctl.d/docker.conf
Yum安装配置docker
## 下载阿里源repo文件
$ sudo yum install -y yum-utils
$ sudo yum-config-manager --add-repo http://mirrors.aliyun.com/repo/Centos-7.repo
$ sudo yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
$ sudo yum clean all && yum makecache
## yum安装
$ sudo yum install -y docker-ce docker-ce-cli
## 设置开机自启
systemctl enable docker
systemctl daemon-reload
## 启动docker
systemctl start docker
## 查看docker信息
docker info
docker version
## docker-client
which docker
## docker daemon
ps aux |grep docker
安装 Compose plugin:
More »