centos8 安装docker
- 下载docker-ce的repo1
curl https://download.docker.com/linux/centos/docker-ce.repo -o /etc/yum.repos.d/docker-ce.repo- 安装依赖(这是相比centos7的关键步骤)
yum install https://download.docker.com/linux/fedora/30/x86_64/stable/Packages/containerd.io-1.2.6-3.3.fc30.x86_64.rpm -y- 安装docker-ce
yum install docker-ce -y- 启动docker
systemctl start docker- 停止docker
systemctl stop dockercentos8 下需要配置防火墙规则, 需要重启防火墙, 否则容器内可能无法访问正常外网
[root@localhost ~]# firewall-cmd --permanent --zone=trusted --change-interface=docker0
[root@localhost ~]# systemctl stop firewalld.service
[root@localhost ~]# systemctl start firewalld.service参考链接: https://www.cnblogs.com/zhouhaibing/p/12247547.html
Dockerfile相关资源: https://github.com/laradock/laradock