使用docker方式编译出来的文件在华为云鲲鹏上运行缺少库,所以选择直接在鲲鹏虚机上编译
安装python3
1
2
3
| yum install git python36 python36-devel python36-pip zlib-devel -y
python3 -m pip install --upgrade pip # 更新pip
|
开始编译
- 拉取compose项目
1
| git clone https://github.com/docker/compose.git
|
- 创建
venv
环境
1
2
3
4
| cd compose/
python3 -m venv venv
source ./venv/bin/activate
python setup.py develop
|
- 安装依赖
1
2
3
| yum install libffi-devel 安装一些依赖库
python setup.py develop
pip install -r ./requirements-build.txt
|
- 开始编译
1
| pyinstaller -F ./docker-compose.spec
|
相关错误解决:
1
| pip install --upgrade setuptools
|
compose/GITSHA No such file or directory
删除以下内容,注意,
也要删除
1
2
3
4
5
6
| ,
(
'compose/GITSHA',
'compose/GITSHA',
'DATA'
)
|
参考资料
https://blog.csdn.net/qq_28808029/article/details/107221921