CentOs7中安装sonarQube服务系列------1.CentOS7中Docker的安装

1.CentOS7中Docker的安装:

因国情原因,访问外网速度较慢,最好使用国内的镜像源。使用国内镜像安装Docker:
(1)阿里镜像站:
更换镜像源:https://developer.aliyun.com/mirror/centos
Docker安装详细说明:https://developer.aliyun.com/mirror/docker-ce

(2)清华大学镜像站:
更换镜像源:https://mirror.tuna.tsinghua.edu.cn/help/centos/
Docker安装详细说明:https://mirror.tuna.tsinghua.edu.cn/help/docker-ce/

2.如果之前安装过 docker,请先删掉:

sudo yum remove docker docker-common docker-selinux docker-engine

安装一些依赖:

sudo yum install -y yum-utils device-mapper-persistent-data lvm2

根据你的发行版下载repo文件(CentOS):

wget -O /etc/yum.repos.d/docker-ce.repo https://download.docker.com/linux/centos/docker-ce.repo

把软件仓库地址替换为 TUNA:

sudo sed -i 's+download.docker.com+mirrors.tuna.tsinghua.edu.cn/docker-ce+' /etc/yum.repos.d/docker-ce.repo

最后安装:

sudo yum makecache fast
sudo yum install docker-ce       //更新并安装Docker-CE
sudo service docker start        //开启Docker服务

3.安装校验:

dockers -version

正常的话,能够看到Client与Server:

设置docker开机自启:

systemctl enable docker

猜你喜欢

转载自blog.csdn.net/qq_39071599/article/details/110230517