首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >在码头集装箱中运行python时的故障分割

在码头集装箱中运行python时的故障分割
EN

Stack Overflow用户
提问于 2022-07-23 17:05:27
回答 1查看 395关注 0票数 3

我正试图在我的机器上的码头上运行 Github项目。这里是我在本地机器上克隆项目后正在运行的我的docker文件。

代码语言:javascript
复制
FROM python:3

RUN mkdir -p /opt/cascade-server
WORKDIR /opt/cascade-server
COPY requirements.txt .
RUN pip install -r requirements.txt

COPY . .
COPY docker_defaults.yml conf/defaults.yml

CMD /bin/bash docker_start.sh 

我所有的配置都是正确的,工作正常。当我在没有码头容器的情况下运行该项目时,它将正确运行。当我构建docker容器来安装它时,当我从码头的最后一行运行下面的shell脚本时,它不会在python cascade.py -vv上结束。

代码语言:javascript
复制
#!/bin/bash

if [ -f "conf/cascade.yml" ]; then
   echo "cascade.yml found. Using existing configuration."
else
   echo "cascade.yml not found. Generating new config file from defaults"
   python cascade.py --setup_with_defaults
fi

python cascade.py -vv 

所有日志都显示正确的结果,直到最后一行从shell脚本执行为止。下面是执行最后一行时的错误。

代码语言:javascript
复制
<frozen importlib._bootstrap>:241: RuntimeWarning: greenlet.greenlet size changed, may indicate binary incompatibility. Expected 152 from C header, got 160 from PyObject
<frozen importlib._bootstrap>:241: RuntimeWarning: greenlet.greenlet size changed, may indicate binary incompatibility. Expected 152 from C header, got 160 from PyObject
<frozen importlib._bootstrap>:241: RuntimeWarning: greenlet.greenlet size changed, may indicate binary incompatibility. Expected 152 from C header, got 160 from PyObject
<frozen importlib._bootstrap>:241: RuntimeWarning: greenlet.greenlet size changed, may indicate binary incompatibility. Expected 152 from C header, got 160 from PyObject
<frozen importlib._bootstrap>:241: RuntimeWarning: greenlet.greenlet size changed, may indicate binary incompatibility. Expected 152 from C header, got 160 from PyObject
/opt/cascade-server/app/async_wrapper.py:44: MonkeyPatchWarning: Monkey-patching ssl after ssl has already been imported may lead to errors, including RecursionError on Python 3.6. It may also silently lead to incorrect behaviour on Python 3.7. Please monkey-patch earlier. See https://github.com/gevent/gevent/issues/1016. Modules that had direct imports (NOT patched): ['urllib3.util (/usr/local/lib/python3.10/site-packages/urllib3/util/__init__.py)', 'pymongo.ssl_context (/usr/local/lib/python3.10/site-packages/pymongo/ssl_context.py)', 'urllib3.util.ssl_ (/usr/local/lib/python3.10/site-packages/urllib3/util/ssl_.py)']. 
  gevent.monkey.patch_all()
docker_start.sh: line 10:    18 Segmentation fault      (core dumped) python cascade.py -vv

python版本

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2022-07-23 17:27:54

尝试将基本图像python:3 (使用Python3.10)更改为python:3.7基本映像,就像本地Python解释器一样。

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/73092700

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档