CentOS7 Docker和Docker-compose

0x01 resolve dependencies

1.1 update source

yum update

1.2 drive and install dependencies

yum-util provide yum-config-manager function, the other two are driven devicemapper dependent 

yum install -y yum-utils devicemapper- persistent-data lvm2

1.3 Setting yum source

yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo

View docker version 1.4 available

yum list docker-ce --showduplicates | sort -r

1.5 Installation docker

  • Default install the latest version
yum install docker-ce

 

1.6 Start docker Service

  • Start the service:
systemctl start docker
  •  Set boot:
systemctl enable docker

 

Installation docker-compose 0x02

2.1 Source installation python3.8

//下载源码,安装依赖
* wget https://www.python.org/ftp/python/3.8.1/Python-3.8.1.tar.xz
* yum -y install gcc zlib-devel openssl-devel
* tar -xJvf Python-3.8.1.tar.xz
* yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel
* yum install zlib* -y
* mkdir /usr/local/python3
​
//编译安装
* cd Python-3.8.1
* ./configure --prefix=/usr/local/python3 --enable-optimizations --with-ssl
* make
*install the make 
// create a soft link 
* LN -s / usr / local / python3 / bin / python3 / usr / bin / python3
 * LN -s / usr / local / python3 / bin / PIP3 / usr / bin / PIP3
  •  Installation detection
// execute the python command to check the version 
* python3 - V
 * -V PIP
  • Upgrade pip

* pip3 install --upgrade pip
* pip install --upgrade setuptools

2.2 Installation docker-compose

pip3 install docker-compose

 

Problems encountered 0x03

3.1 question 1-- error of about subprocess32

3.1.1 Description of the problem

See Pictures

01.jpg

3.1.2 Solution

yum -y install python-devel python-subprocess32

 

3.2 Question 2 - Tips for uninstall subprocess32 of

3.2.1 Description of the problem

02.jpg

 

3.2.2 Solution

Use pip mounted reliance python3 docker-compose the environment, while carrying centos7 default Python version 2.7.5, after the first execution pip install docker-compose failure python-subprocess32 package after installation, the system environment information corresponding Python record file is not updated, the need to remove, let the system automatically re-generate.

find / -name subpro.egg-info /usr/lib64/python2.7/site-packages/subprocess32-3.2.6-py2.7.egg-info 
find / -name subpro.egg-info |xargs rm -rf

Perform the installation, pip install docker-compose again to success

 
the public

Guess you like

Origin www.cnblogs.com/stone-dan-dan/p/CentOS7_Docker.html