我正试图在我的机器上的码头上运行这 Github项目。这里是我在本地机器上克隆项目后正在运行的我的docker文件。
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上结束。
#!/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脚本执行为止。下面是执行最后一行时的错误。
<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 -vvpython版本

发布于 2022-07-23 17:27:54
尝试将基本图像python:3 (使用Python3.10)更改为python:3.7基本映像,就像本地Python解释器一样。
https://stackoverflow.com/questions/73092700
复制相似问题