(运维各种坑)用docker部署django项目(一)

新centeros 7 环境开始部署django项目,
一种一步步来,一种docker.


安装docker1.13

首先:更换yum源:

1.卸载RedHat自带的yum包
#查看已安装的yum

rpm -qa|grep yum

#卸载已安装的yum
rpm -qa|grep yum|xargs rpm -e --nodeps

#再次查看已安装的yum
rpm -qa|grep yum

2,然后查看查看系统版本  :cat /etc/redhat-release

我的是centeros7
要下载下面5个包;可以单独下载推上去,你也可以直接使用wget命令直接下载,命令如下:

# wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-3.4.3-161.el7.centos.noarch.rpm

# wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.31-50.el7.noarch.rpm

# wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-metadata-parser-1.1.4-10.el7.x86_64.rpm

# wget http://mirrors.163.com/centos/7/os/x86_64/Packages/python-urlgrabber-3.10-9.el7.noarch.rpm

# wget http://mirrors.163.com/centos/7/os/x86_64/Packages/python-iniparse-0.4-9.el7.noarch.rpm

接下来的一条需要自己下载然后上传 因为wget下载不了 (升级rpm)
http://mirrors.163.com/centos/7/os/x86_64/Packages/rpm-4.11.3-35.el7.x86_64.rpm

然后:
逐条安装:
# rpm -ivh python-iniparse-0.4-9.el7.noarch.rpm

                                                                                               
# rpm -ivh python-urlgrabber-3.10-9.el7.noarch.rpm


# rpm -ivh yum-metadata-parser-1.1.4-10.el7.x86_64.rpm

3,然后需要先安装这个:
升级安装

# rpm -Uvh rpm-4.11.3-35.el7.x86_64.rpm --nodeps

# rpm -Uvh python-urlgrabber-3.10-9.el7.noarch.rpm --nodeps

4,然后再剩下的俩包一起装:

# rpm -ivh yum-3.4.3-161.el7.centos.noarch.rpm yum-plugin-fastestmirror-1.1.31-50.el7.noarch.rpm



5,查看所有yum包,确认都完整.

[root@localhost ~]# rpm -qa | grep yum

6.备份Redhat自带的repo文件
[root@rhel-server etc]# cd /etc/yum.repos.d

7.下载163的repo文件
[root@rhel-server yum.repos.d]# wget http://mirrors.163.com/.help/CentOS7-Base-163.repo
[root@rhel-server yum.repos.d]# ls

CentOS6-Base-163.repo  rhel-source.repo.bak

8,运行以下命令生成缓存

yum clean all
yum makecache

9,然后安装docker;
 yum install -y docker-engine --skip-broken

验证:
docker version

Client:
 Version:         1.13.1
 API version:     1.26


ok


接下来就是安装自己需要的docker镜像了,预知后事,下片分解.





你可能感兴趣的:(全栈)