1 sudo yum install -y yum-utils device-mapper-persistent-data lvm2
2.sudo yum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
///3.4两步骤是开启开发板和测试版的,线上正式版不要开启(enable/disable)
####3.sudo yum-config-manager --disable docker-ce-edge
####4.sudo yum-config-manager --disable docker-ce-test
5.sudo yum makecache fast
6.sudo yum install docker-ce
7.sudo service docker start(sudo systemctl start docker)
8.sudo cp -r /var/lib/docker/ /letv
9.sudo rm -rf /var/lib/docker
10.sudo ln -s /letv/docker /var/lib/docker
11.sudo service docker restart
12.sudo service docker status
13.sudo docker info
启动失败解决:
之前的内核 把iptables里的nat表关了
开启了 就好了
一、请添加内核配置参数以启用这些功能。
1 $ sudo tee -a /etc/sysctl.conf <<-EOF
2 net.bridge.bridge-nf-call-ip6tables = 1
3 net.bridge.bridge-nf-call-iptables = 1
4 EOF
二、重新加载 sysctl.conf
sudo sysctl -p
删除docker:
sudo yum remove docker docker-client docker-client-latest docker-common docker-latest docker-latest-logrotate docker-logrotate docker-engine
yum list installed|grep docker
[root@localhost ~]#yum –y remove docker.x86_64
[root@localhost ~]#yum –y remove docker-client.x86_64
[root@localhost ~]#yum –y remove docker-common.x86_64
rm -rf /var/lib/docker
rm -rf /var/lib/docker-engine
rm -rf /letv/docker