yum -y install wget
mv -f /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
yum makecache
yum update -y
yum -y install git zsh nano
#安装oh-my-zsh
curl -L http://install.ohmyz.sh | sh
#安装docker
curl -sSL http://acs-public-mirror.oss-cn-hangzhou.aliyuncs.com/docker-engine/internet | sh -
#设置docker registry 镜像
sudo cp -n /lib/systemd/system/docker.service /etc/systemd/system/docker.service
sudo sed -i "s|ExecStart=/usr/bin/dockerd|ExecStart=/usr/bin/dockerd --registry-mirror=https://1234abcd.mirror.aliyuncs.com|g" /etc/systemd/system/docker.service
#设置docker 自启动服务
systemctl enable docker.service
systemctl daemon-reload
systemctl restart docker.service
#验证docker
docker run --rm hello-world
centos 7 初始化脚本 常用服务
最后编辑于 :
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。
推荐阅读更多精彩内容
- Linux服务器 CentOS 6系列最小化安装优化脚本详解02————修改history记录、定时校正服务器时间...
- Linux服务器 CentOS 6系列最小化安装优化脚本详解01————yum优化、优化启动服务、调整TTY数量、...
- 拿到服务器的ip和初始密码以后。我们先要用远程连接工具putty或者xshell连接服务器主机。 一、挂载数据盘 ...