Unable to build python3 container with pyldap requirement

Latest response

Base image is python:3

Requirements.txt:

Django==2.0.2
django-auth-ldap==1.3.0
django-bootstrap3==9.1.0
django-crispy-forms==1.7.0
django-extensions==2.0.0
django-filter==1.1.0
djangorestframework==3.7.7
Markdown==2.6.11
psycopg2==2.7.4
psycopg2-binary==2.7.4
pyldap==2.4.45
pytz==2018.3
six==1.11.0
typing==3.6.4

Getting this error when I build the image:

gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DHAVE_SASL -DHAVE_TLS -DHAVE_LIBLDAP_R -DHAVE_LIBLDAP_R -DLDAPMODULE_VERSION=2.4.45 -IModules -I/usr/include -I/usr/include/sasl -I/usr/local/include -I/usr/local/include/sasl -I/usr/local/include/python3.6m -c Modules/LDAPObject.c -o build/temp.linux-x86_64-3.6/Modules/LDAPObject.o
In file included from Modules/LDAPObject.c:8:0:
Modules/errors.h:7:18: fatal error: lber.h: No such file or directory
#include "lber.h"
^
compilation terminated.
error: command 'gcc' failed with exit status 1

yum is not installed on base image so I can't add a RUN statement to install the dependency lber.h. Any ideas how to get around this?

Responses