阅读 37

DigitalOcean-CentOS环境搭建

环境搭建

Docker

参考Docker官网-docs.docker.com/install/lin…

移除旧版

[root@master ~]# yum remove docker docker-client docker-client-latest docker-common docker-latest docker-latest-logrotate docker-logrotate docker-engine

Loaded plugins: fastestmirror
No Match for argument: docker
No Match for argument: docker-client
No Match for argument: docker-client-latest
No Match for argument: docker-common
No Match for argument: docker-latest
No Match for argument: docker-latest-logrotate
No Match for argument: docker-logrotate
No Match for argument: docker-engine
No Packages marked for removal
复制代码

其实DigitalOcean这边的系统还是干净的,没有安装多余的部件,直接跑下面的命令就行

sudo yum install -y yum-utils device-mapper-persistent-data lvm2
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
sudo yum install -y docker-ce docker-ce-cli containerd.io
sudo systemctl start docker
sudo docker run hello-world
复制代码

OK,hello-world出来,docker安装完成,登录一下

[root@master ~]# docker login
Login with your Docker ID to push and pull images from Docker Hub. If you don't have a Docker ID, head over to https://hub.docker.com to create one.
Username: m******
Password: 
WARNING! Your password will be stored unencrypted in /root/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store

Login Succeeded

复制代码

服务器地域在外面,不需要配置国内镜像加速

yum update
yum install -y wget
yum install -y vim
yum install -y lrzsz # For XShell file transfer
yum install -y curl-devel expat-devel gettext-devel openssl-devel zlib-devel
yum install -y gcc perl-ExtUtils-MakeMaker
mkdir temp workspace
cd temp/

# Git
yum remove -y git-1.8.3.1
wget https://github.com/git/git/archive/v2.21.0.tar.gz
tar xzf v2.21.0.tar.gz # 解压
cd git-2.21.0/
make prefix=/usr/local/git all # 指定位置进行编译
make prefix=/usr/local/git install # 指定位置进行安装
echo "export PATH=$PATH:/usr/local/git/bin" >> /etc/bashrc # 设置环境变量
source /etc/bashrc # 刷新
git --version


复制代码
关注下面的标签,发现更多相似文章
评论