添加內(nèi)核參數(shù)
默認(rèn)配置下已亥,在 CentOS 使用 Docker 可能會(huì)碰到下面的這些警告信息:
WARNING: bridge-nf-call-iptables is disabled
WARNING: bridge-nf-call-ip6tables is disabled
添加內(nèi)核配置參數(shù)以啟用這些功能:
sudo tee -a /etc/sysctl.conf <<EOF
net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1
EOF
然后重新加載 sysctl.conf 即可:
sudo sysctl -p
添加 yum 源
sudo tee /etc/yum.repos.d/docker.repo <<EOF
[dockerrepo]
name=Docker Repository
baseurl=http://yum.dockerproject.org/repo/main/centos/7/
enabled=1
gpgcheck=1
gpgkey=http://yum.dockerproject.org/gpg
EOF
安裝 Docker
更新 yum 軟件源緩存,并安裝 docker-engine。
sudo yum -y install docker-engine
其它同“ubuntu上apt安裝docker”
搜索其中關(guān)鍵字centos