Installation and centos7 docker docker [turn] Compose

1. Remove previously installed before the old version docker, if any.

Copy the code
$ sudo yum remove docker \
                  docker-client \
                  docker-client-latest \
                  docker-common \
                  docker-latest \
                  docker-latest-logrotate \
                  docker-logrotate \
                  docker-selinux \
                  docker-engine-selinux \
                  docker-engine
Copy the code

2. Use the repository installation docker ce

Copy the code
$ 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-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo ## 阿里源,速度杠杠的
$ yum list docker-ce --showduplicates | sort -r ## 如果想安装指定版本的docker-ce,可以先用命令查看版本号
$ sudo yum install docker-ce ## 直接运行会默认安装最新版
$ sudo yum install docker-ce-<VERSION STRING>  #例如yum install docker-ce-18.06.3.ce
Copy the code

3. Installation docker-compose

curl -L https://github.com/docker/compose/releases/download/1.23.2/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose

Installation above the current latest stable version compose, you can find the latest version https://github.com/docker/compose/releases on github

4. unloading docker-ce

$ sudo yum remove docker-ce
$ sudo rm -rf /var/lib/docker

The unloading docker-compse

sudo rm /usr/local/bin/docker-compose

Guess you like

Origin www.cnblogs.com/zxcnn/p/11102034.html