简体   繁体   English

软件包在Docker容器中失败。 重新安装即可。 为什么?

[英]Package fails in docker container. Reinstall and it works. Why?

I am running a docker container that works perfectly on multiple different hosts. 我正在运行一个可以在多个不同主机上完美运行的Docker容器。 However when I run on AWS cr1.8xlarge one of the packages (bcolz) fails with "invalid instruction" error. 但是,当我在AWS cr1.8xlarge上运行时,其中一个软件包(bcolz)失败,并显示“无效指令”错误。

I exec into the container and run bcolz.test() which fails. 我执行到容器并运行bcolz.test()失败。 But if I pip uninstall bcolz and then reinstall the same version with pip install bcolz==1.1.1 and run bcolz.test() again and it works. 但是,如果我用pip卸载bcolz,然后用pip重新安装相同版本,则安装bcolz == 1.1.1并再次运行bcolz.test()即可。

How can this be? 怎么会这样?

The setup.py compiles bcolz with different flags depending on the CPU. setup.py根据CPU的不同,使用不同的标志编译bcolz。 This means bcolz is not portable in a docker container. 这意味着bcolz无法在docker容器中移植。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM