一、安装CentOS 7.9
1. 从阿里镜像下载:
https://mirrors.aliyun.com/centos/7.9.2009/isos/x86_64/?spm=a2c6h.25603864.0.0.786ff5ad8J2jGC
2. 虚拟机挂载ISO文件后,NEXT&NEXT安装
3. Minial版本下,解决ifconfig命令找不到的问题
https://blog.csdn.net/afjklafjklajflafja/article/details/123775447
4. 更新Linux包
yum update
5. 设置静态IP地址
cd /etc/sysconfig/network-scripts/ifcfg vi ifcfg-enp0s3
二、安装Docker
1. 安装docker依赖包
yum install -y yum-utils device-mapper-persistent-data lvm2 --skip-broken
2. 设置Yum镜像源加速
yum-config-manager \ --add-repo \ https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo sed -i 's/download.docker.com/mirrors.aliyun.com\/docker-ce/g' /etc/yum.repos.d/docker-ce.repo yum makecache fast
3. 安装Docker社区版
yum install -y docker-ce
4. 设置Docker加速镜像地址
cat /etc/docker/daemon.json <<-'EOF' { "registry-mirrors": ["https://reg-mirror.qiniu.com/"] } EOF
5. 启动Docker并设置开机自动启动
systemctl start docker && systemctl enable docker
6.测试
构建nginx容器实例,随机端口映射,后台运行
docker run -d -P -name mynginx
标签:centos,ce,yum,Docker,7.9,docker From: https://www.cnblogs.com/heho/p/16889411.html