首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >启动容器进程导致"exec:\"uwsgi\":在$PATH中找不到可执行文件“:未知

启动容器进程导致"exec:\"uwsgi\":在$PATH中找不到可执行文件“:未知
EN

Stack Overflow用户
提问于 2020-11-05 03:45:08
回答 1查看 1.3K关注 0票数 1

我正在尝试启动一个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“。我认为它与我的dockerfile和uwsgi文件有关,但我不确定为什么我无法启动我的容器。我已经通过pip安装了uwsgi。除了安装uwsgi之外,我还没有找到任何其他解决方案,尽管它已经在那里了

Docker文件

代码语言:javascript
复制
##
## Dockerfile to generate a Docker image from a GeoDjango project
##

# Start from an existing image with Python 3.8 installed
FROM python:3.8

MAINTAINER Mark Foley

# Run a series of Linux commands to ensure that
# 1. Everything is up-to-date and
# 2. Install GDAL
RUN apt-get -y update && apt-get -y upgrade && apt-get -y install libgdal-dev

# Make a working directoir in the image and set it as working dir.
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app

# make sure that pip & setuptools are installed and to date
RUN pip install --upgrade pip setuptools wheel

# Get the following libraries. We caan install them "globally" on the image as it will contain only our project
RUN apt-get -y install build-essential python-cffi libcairo2 libpango-1.0-0 libpangocairo-1.0-0 libgdk-pixbuf2.0-0 libffi-dev shared-mime-info

# You should have already exported your Python library reuirements to a "requiremnts.txt" file using pip.
# Now copy this to the image and install everything in it.
COPY requirements.txt /usr/src/app
RUN pip install -r requirements.txt

# Copy everything in your Django project to the image.
COPY . /usr/src/app

# Make sure that static files are up to date and available
RUN python manage.py collectstatic --no-input

# Expose port 8001 on the image. We'll map a localhost port to this later.
EXPOSE 8001

# Run "uwsgi". uWSGI is a Web Server Gateway Interface (WSGI) server implementation that is typically used to run Python
# web applications.
CMD ["uwsgi", "--ini", "uwsgi.ini"]

UWSGI文件

代码语言:javascript
复制
[uwsgi]

#=======================
# DO NOT EDIT THIS FILE
#=======================

# chdir to the folder of this config file
chdir = %d
# %d is the dir this configuration file is in
#socket = %dapp.sock
http = :8001
# load the module from wsgi.py, it is a python path from
# the directory above.
module = geodjango_2021.wsgi:application
# allow anyone to connect to the socket (666). This is very permissive
chmod-socket=664

master = true
processes = 4
vacuum = true
#harakiri = 30
#threads = 2 
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2021-01-22 11:40:17

尝试在requirement.txt文件中安装uwsgi

$ pip安装uwsgi

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

https://stackoverflow.com/questions/64686728

复制
相关文章

相似问题

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