赞
踩
1、yum更新
# sudo yum update
2、如果安装docker旧版本,旧版本的卸载
# sudo yum remove docker docker-common docker-selinux docker-engine
3、安装需要的软件包, yum-util 提供yum-config-manager功能,另外两个是devicemapper驱动依赖的
# sudo yum install -y yum-utils device-mapper-persistent-data lvm2
4、设置yum源
# sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
5、可以查看所有仓库中所有docker版本,并选择特定版本安装
# yum list docker-ce --showduplicates | sort -r
6、安装稳定版本
# sudo yum install docker-ce
(安装特定版本)sudo yum install <FQPN> # 例如:sudo yum install docker-ce-17.12.0.ce 7、启动并加入开机启动
# sudo systemctl start docker # sudo systemctl enable docker
8、验证安装是否成功(有client和service两部分表示docker安装启动都成功了)
9、安装docker-compose # sudo pip install -U docker-compose
pip在centos也没有,如下处理
1.查看是否安装依赖包,没安装先安装:
sudo yum install epel-release
2.更新文件库
sudo yum -y update
3.安装pip
sudo yum -y install python-pip
这步报错了:
执行:
pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple -U docker-compose
没有pip3:
全部操作都在root
用户下执行
- yum -y groupinstall "Development tools"
- yum install gcc patch libffi-devel python3-devel zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel -y
- yum install libffi-devel -y
- cd #回到用户目录
- wget https://www.python.org/ftp/python/3.7.6/Python-3.7.6.tar.xz
- tar -xf Python-3.7.6.tar.xz
- mkdir /usr/local/python-3.7.6 #创建编译安装目录
- cd Python-3.7.6
- ./configure --prefix=/usr/local/python3.7.6 --with-ssl
- make && make install
- ln -s /usr/local/python-3.7.6/bin/python3.7 /usr/local/bin/python3
- ln -s /usr/local/python-3.7.6/bin/pip3 /usr/local/bin/pip3
python3 -V pip3 -V
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。