Docker系列---【docker的安装】

docker的优点:

  1.快速上手新技术,把精力放在业务上而非安装和配置服务器;

  2.快速搭建开发环境所需的各种服务器程序。

1.更新yum

yum update

2.编辑yum源

vim /etc/yum.repos.d/docker.repo

# 输入如下
[dockerrepo]
name=Docker Repository
baseurl=https://mirrors.tuna.tsinghua.edu.cn/docker/yum/repo/centos7
enabled=1
gpgcheck=1
gpgkey=https://mirrors.tuna.tsinghua.edu.cn/docker/yum/gpg

3.安装docker

yum install docker-engine

4.启动docker服务

systemctl start docker.service

5.更改docker仓库为国内仓库(可自己到dao上自己申请私服仓库)

curl -sSL https://get.daocloud.io/daotools/set_mirror.sh | sh -s http://00b257d9.m.daocloud.io

6.重启docker

systemctl restart docker.service
以上,完成docker安装,可以执行 docker run hello-world 测试一下安装是否成功

安装docker-compose
yum -y install epel-release
yum install python-pip
pip install --upgrade pip
pip install docker-compose --ignore-installed

  



愿你走出半生,归来仍是少年!
原文地址:https://www.cnblogs.com/hujunwei/p/13956615.html