centos7上yum安装docker

2018-05-03  本文已影响0人  linice

添加内核参数

默认配置下,在 CentOS 使用 Docker 可能会碰到下面的这些警告信息:
WARNING: bridge-nf-call-iptables is disabled
WARNING: bridge-nf-call-ip6tables is disabled

添加内核配置参数以启用这些功能:

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”

搜索其中关键字centos

上一篇 下一篇

猜你喜欢

热点阅读