//拉取指定版本的 CentOS 镜像

docker pull centos:centos7

//运行容器

docker run -itd --name centos-test centos:centos7

//新开个窗口,进入容器交互

docker exec -it -u root centos-test /bin/bash

//docker修改时区(容器内操作)

cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

echo Asia/Shanghai > /etc/timezone

//安装常用程序

yum -y install net-tools 

yum -y install vim*

yum -y install sudo

yum -y install wget

yum -y install expect

yum -y install lsof

yum -y install psmisc

//开启ssh服务

到这一个基本的centos7系统镜像就配置完成了
 

Logo

腾讯云面向开发者汇聚海量精品云计算使用和开发经验,营造开放的云计算技术生态圈。

更多推荐