2

I have a Python flask application which requires LDAP authentication. I'm trying to create a Docker file for this and the docker build is failing with the following error,

In file included from Modules/LDAPObject.c:8:
Modules/constants.h:7:10: fatal error: lber.h: No such file or directory
 #include "lber.h"
          ^~~~~~~~
compilation terminated.
error: command 'gcc' failed with exit status 1

I have python-ldap already installed, also pip install -r requirements.txt works fine but Docker is giving an error. I have Mac OS.

I looked for previous issues and found the you should try installing dependancies,

sudo apt-get install libsasl2-dev python-dev libldap2-dev libssl-dev

But how do I fix this in Mac?

This is an extract from DockerFile,

RUN pip install -r requirements.txt

Also I'm not using virtual environment.

PyCoder
  • 23
  • 4

1 Answers1

0

Is it failing while you're trying to build the image?

If so then it looks like your docker image does not come with gcc pre-installed in it. Try running:

yum install gcc / python-devel

In your Dockerfile before attempting to install the python packages.

  • Yes it's failing while building the image. Looks like we will be getting this error wile the dependancies of ldap are not satisfied but I have included all the dependancies in the requirements.txt. – PyCoder Jul 22 '19 at 19:27