centos 7 初始化脚本 常用服务

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 初始化脚本 常用服务)