分析需要的文件
- RPM包
- 容器镜像
- pip 包
流程
1、配置完yum源,设置开启缓存。手动部署完,制作 repo 源
2、手动部署完,将所有容器打包
3、手动部署完,统计 python模块包 写到 requirements.txt,下载收集并编写安装脚本。
容器镜像
全部导出
docker save `docker images --format "{{.Repository}}:{{.Tag}}"` | gzip > kolla_centos_train_min.tar.gz
导入
docker load -i kolla_centos_train_min.tar.gz
rpm 软件包
[root@kolla ~]# mkdir /repo
[root@kolla ~]# cat /etc/yum.conf
[main]
cachedir=/repo
keepcache=1
...
[root@kolla ~]# yum install -y createrepo
[root@kolla ~]# cd /repo
[root@kolla repo]# mkdir -p kolla_centos_train_rpm/Packages
[root@kolla repo]# cp -ra */packages/* kolla_centos_train_rpm/Packages
[root@kolla repo]# cd kolla_centos_train_rpm
[root@kolla kolla_centos_train_rpm]# createrepo ./
[root@kolla kolla_centos_train_rpm]# ls
Packages repodata
[root@kolla kolla_centos_train_rpm]# cd /repo
[root@kolla repo]# tar cfz kolla_centos_train_rpm.tar.gz kolla_centos_train_rpm
pip 依赖包
[root@kolla kolla_centos_train_whl]# cat requirements.txt
setuptools==22.0.5
pip==20.3.4
wheel
kolla-ansible==9.1.0
[root@kolla kolla_centos_train_whl]# mkdir packages
[root@kolla kolla_centos_train_whl]# pip download -d packages -r requirements.txt
[root@kolla kolla_centos_train_whl]# cat install.sh
#!/bin/bash
pip install --no-index --find-links=./packages/ setuptools==22.0.5
pip install --no-index --find-links=./packages/ pip==20.3.4
pip install --no-index --find-links=./packages/ wheel
pip install --no-index --find-links=./packages/ kolla-ansible==9.1.0 --ignore-installed PyYAML
[root@kolla ~]# tar cfz kolla_centos_train_whl.tar.gz kolla_centos_train_whl/
评论