小编Jac*_*ter的帖子

Docker python3.8 alpine python-ldab安装失败缺少lber.h

我正在尝试在 Docker 中 pip install python-ldap 但缺少 lber.h。我需要 python-ldap 因为我正在尝试为我的应用程序实现一个与操作系统无关的 SSO,现在遵循此方法并希望它不会破坏我的应用程序的其余部分https://code.tutsplus.com/tutorials/flask-authentication -with-ldap--cms-23101

我努力了

RUN apk add libsasl2-dev libldap2-dev libssl-dev

RUN apk --no-cache add libsasl2-dev libldap2-dev libssl-dev

但我收到以下错误:

ERROR: unsatisfiable constraints:
  libldap2-dev (missing):
    required by: world[libldap2-dev]
  libsasl2-dev (missing):
    required by: world[libsasl2-dev]
  libssl-dev (missing):
    required by: world[libssl-dev]
Run Code Online (Sandbox Code Playgroud)

访问https://pkgs.alpinelinux.org/packages?name=libldap2-dev&branch=edge我觉得这些包可能确实不存在于 alpine python 映像中。因此,我尝试用上述链接中存在的软件包替换安装,即: openssl libsasl libldap 这也不起作用,并且与不安装任何软件包具有相同的效果,即出现标头丢失错误:

Modules/constants.h:7:10: 致命错误: lber.h: 没有这样的文件或目录

 #include "lber.h"
          ^~~~~~~~
compilation terminated.
error: command 'gcc' failed with exit status 1
Run Code Online (Sandbox Code Playgroud)

后果/tmp/pip-install-doifa8k9/python-ldap/

我的 Dockerfile:

    FROM python:3.8.0-alpine …
Run Code Online (Sandbox Code Playgroud)

ldap python-3.x docker

2
推荐指数
1
解决办法
5060
查看次数

标签 统计

docker ×1

ldap ×1

python-3.x ×1