gpt4 book ai didi

python - Docker:命令返回非零代码:137

转载 作者:行者123 更新时间:2023-12-05 01:38:07 28 4
gpt4 key购买 nike

我的docker文件如下:

#Use python 3.6 image
FROM python:3.6
ENV PYTHONUNBUFFERED 1

#install required packages
RUN apt-get update
RUN apt-get install libsasl2-dev libldap2-dev libssl-dev python3-dev psmisc -y

#install a pip package
#Note: This pip package has a completely configured django project in it
RUN pip install <pip-package>

#Run a script
#Note: Here appmanage.py is a file inside the pip installed location(site-packages), but it will be accessible directly without cd to the folder
RUN appmanage.py appconfig appadd.json

#The <pip-packge> installed comes with a built in django package, so running it with following CMD
#Note: Here manage.py is present inside the pip package folder but it is accesible directly
CMD ["manage.py","runserver","0.0.0.0:8000"]

当我运行时:

sudo docker build -t test-app .

dockerfile 中的步骤直到:RUN appmanage.py appconfig 按预期成功运行,但之后出现错误:

The command '/bin/sh -c appmanage.py appconfig ' returned a non-zero code: 137

当我用谷歌搜索错误时,我得到的建议是内存不足。但我已经验证,系统(centos)有足够的内存。

附加信息

RUN appmanage.py appconfig 执行期间的命令行输出是:

Step 7/8 : RUN appmanage.py appconfig
---> Running in 23cffaacc81f

======================================================================================
configuring katana apps...
Please do not quit (or) kill the server manually, wait until the server closes itself...!
======================================================================================
Performing system checks...

System check identified no issues (0 silenced).
February 08, 2020 - 12:01:45
Django version 2.1.2, using settings 'katana.wui.settings'
Starting development server at http://127.0.0.1:9999/
Quit the server with CONTROL-C.
9999/tcp:
20Killed

最佳答案

如前所述,命令 RUN appmanage.py appconfig appAdd.json按预期成功运行并报告 System check identified no issues (0 silenced). .

此外,命令“坚持”杀死自己并返回退出代码 137。要使其正常工作的最小更改是更新您的 Dockerfile。像

...
#Run a script
#Note: Here appmanage.py is a file inside the pip installed location(site-packages), but it will be accessible directly without cd to the folder
RUN appmanage.py appconfig appAdd.json || true
...

这将强制忽略上一个命令的返回退出代码并继续构建。

关于python - Docker:命令返回非零代码:137,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60126842/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com