环境准备
centos7
Uninstall old versions
yum remove docker \
docker-client \
docker-client-latest \
docker-common \
docker-latest \
docker-latest-logrotate \
docker-logrotate \
docker-engine
Install using the repository
yum install -y yum-utils epel-release device-mapper-persistent-data lvm2
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
Install Docker Engine
# Install the latest version of Docker Engine and containerd,
yum install -y docker-ce docker-ce-cli containerd.io
# To install a specific version of Docker Engine
yum list docker-ce --showduplicates | sort -r
yum install docker-ce-<VERSION_STRING> docker-ce-cli-<VERSION_STRING> containerd.io
配置 Docker 守护程序,尤其是使用 systemd 来管理容器的cgroup
sudo mkdir /etc/docker
cat <<EOF | sudo tee /etc/docker/daemon.json
{
"exec-opts": ["native.cgroupdriver=systemd"],
"log-driver": "json-file",
"log-opts": {
"max-size": "100m"
},
"storage-driver": "overlay2"
}
EOF
重新启动 Docker 并在启动时启用
sudo systemctl enable docker
sudo systemctl daemon-reload
sudo systemctl restart docker
Verify that Docker Engine is installed correctly by running the hello-world
image
docker run hello-world
Uninstall Docker Engine
yum remove docker-ce docker-ce-cli containerd.io
rm -rf /var/lib/docker
rm -rf /var/lib/containerd
故障处理
WARNING: bridge-nf-call-iptables is disabled
docker info 时候 会提示
WARNING: bridge-nf-call-iptables is disabled
WARNING: bridge-nf-call-ip6tables is disabled
vi /etc/sysctl.conf
net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1
sysctl -p
标签:bridge,ce,yum,install,docker,Docker
From: https://www.cnblogs.com/wl30564/p/16939360.html