docker快速部署centos7并进行初始化_配置yum源

# 启动容器
docker run -it -d --name centos7 centos:centos7 bash
# 进入容器
docker exec -it centos7 bash
# 初始化yum源
rm -f /etc/yum.repos.d/*
curl https://mirrors.aliyun.com/repo/Centos-7.repo > /etc/yum.repos.d/CentOS-Base.repo
curl https://mirrors.aliyun.com/repo/epel-7.repo > /etc/yum.repos.d/epel.repo
yum makecache fast
# 安装常用程序
yum install -y htop iputils nmap tree lrzsz
posted @ 2024-09-04 11:54  chenzechao  阅读(14)  评论(0编辑  收藏  举报