docker及docker-compose下载安装:
sudo yum install -y yum-utils device-mapper-persistent-data lvm2
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
sudo yum install -y docker-ce docker-ce-cli containerd.io
sudo systemctl start docker
sudo curl -L 'https://github.com/docker/compose/releases/download/1.23.2/docker-compose-Linux-x86_64' -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
执行sudo docker run hello-world
成功说明docker安装成功
执行docker-compose version
成功说明docker-compose安装成功
遇到问题可尝试重启网络服务:service network restart
docker默认安装路径:/var/lib/docker
注:镜像和容器也在这里
docker-compose安装路径:/usr/local/bin/docker-compose
证书根据需要放置在指定路径
DNS配置:etc/hosts
文件中添加对应配置
命令整理:
参考