linux初部署shell脚本

#!/bin/bash
cp -a /etc/apt/sources.list /etc/apt/sources.list.bak2
#保存备份文件
sed -i "s@http://.*archive.ubuntu.com@http://mirrors.huaweicloud.com@g" /etc/apt/sources.list
#替换源
sed -i "s@http://.*security.ubuntu.com@http://mirrors.huaweicloud.com@g" /etc/apt/sources.list
#替换源
apt-get update
#更新源
apt install docker.io -y
#安装docker
systemctl start docker
#启动docker
systemctl enable docker
#开机自启动
docker -v
#查看docker安装是否成功
sudo groupadd docker

sudo gpasswd -a ${USER} docker

sudo service docker restart

wget http://slhl.shyyhy.com/daemon.json

mv daemon.json /etc/docker/daemon.json
#更换国内源
#vim /etc/docker/daemon.json

#{
#"registry-mirrors": ["http://hub-mirror.c.163.com"]
#}

#重启docker
systemctl restart docker

#安装pip
apt-get install python-pip -y
pip uninstall docker-compose
#卸载之前可能存在的docker-compose,
pip install docker-compose
#使用python安装docker-compose,报错的话使用 pip3 install docker-compose
docker-compose --version
#查看下docker-compose是否安装成功
apt-get install -y nginx
#安装nginx 本次安装公司有专门的服务器用于nginx转发,但是配置都是差不多的。
点赞
  1. bursa escort说道:
    Google Chrome Windows 10

    Thank you, I have recently been looking for information about this topic for a long time and yours is the best I have came upon till now. But, what about the conclusion? Are you sure concerning the supply? Leeann Angeli Burch

  2. erotik说道:
    Google Chrome Windows 10

    Your article makes perfect sense. Writing that is worth reading. oh yeah btw also visit my website. Thanks Alyson Niki Avram

  3. darlina说道:
    Google Chrome Windows 10

    I must express my love for your generosity in support of persons who need help with in this concern. Your personal dedication to getting the message throughout appears to be extremely informative and has continuously enabled some individuals just like me to arrive at their targets. Your new insightful advice means a great deal to me and additionally to my colleagues. Warm regards; from everyone of us. Karine Page Fox

发表评论

昵称和uid可以选填一个,填邮箱必填(留言回复后将会发邮件给你)
tips:输入uid可以快速获得你的昵称和头像

Title - Artist
0:00