每次我运行docker-compose时,我都会得到与uwsgi路径有关的此错误
重新创建flask_app ... nginx是最新的 重新创建flask_app ...错误
错误:for flask_app无法启动服务烧瓶:OCI运行时创建失败:container_linux.go:349:启动容器进程导致“ exec:“ uwsgi”:在$ PATH中找不到可执行文件”:未知
错误:对于烧瓶无法启动服务烧瓶:OCI运行时创建失败:container_linux.go:349:启动容器进程导致“ exec:” uwsgi”:在$ PATH中找不到可执行文件”:未知 错误:启动项目时遇到错误。
Docker文件
FROM python:3.7.2-stretch
WORKDIR /Back-end
ADD . /Back-end
## Install the dependencies
RUN pip3 install -r requirements.txt
## run the command to start uWSGI
CMD ["uwsgi", "app.ini"]
app.ini文件
[uwsgi]
wsgi-file = wsgi.py
callable = app
socket = :8080
processes = 4
threads = 2
master = true
chmod-socket = 660
vacuum = true
die-on-term = true
答案 0 :(得分:2)
您没有在映像中安装uwsgi
。我可以通过此docker调用重现您的确切错误消息:
$ docker run python:stretch uwsgi
docker: Error response from daemon: OCI runtime create failed: container_linux.go:349: starting container process caused "exec: \"uwsgi\": executable file not found in $PATH": unknown.
以交互方式启动python:stretch
容器并通过uwsgi
安装pip
时,我可以成功执行命令:
$ pip install uwsgi
....
$ uwsgi --version
2.0.19.1
因此,您应该可以在构建映像时通过向您的requirements.txt文件中添加uwsgi
来解决问题。