【问题标题】:Error while building python docker container with uWSGI使用 uWSGI 构建 python docker 容器时出错
【发布时间】:2021-01-17 13:27:31
【问题描述】:

这是我的 Dockerfile:

FROM python:3.7-alpine


RUN mkdir -p /usr/src/app 
WORKDIR /usr/src/app

COPY . /usr/src/app

RUN apk --update add gcc build-base freetype-dev libpng-dev openblas-dev musl-dev
RUN apk update

RUN pip install --no-cache-dir -r requirements.txt

EXPOSE 5000

CMD ["uwsgi", "app.ini"]

在构建uwsgi轮时遇到错误:

In file included from core/utils.c:1:
  ./uwsgi.h:238:10: fatal error: linux/limits.h: No such file or directory
    238 | #include <linux/limits.h>
        |          ^~~~~~~~~~~~~~~~

我需要向 Dockerfile 添加什么包?+

【问题讨论】:

  • pkgs.alpinelinux.org上,选择顶部的“内容”,输入limits.h作为文件名,**/linux作为路径。

标签: python docker uwsgi wsgi


【解决方案1】:

尝试添加 apk add linux-headers,看起来 uwsgi 在构建过程中缺少一些标头,可能是由于 alpine 非常简单

【讨论】:

    猜你喜欢
    • 2015-10-19
    • 2018-03-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-01-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多