0

Based on answers to the question Python: can't install python-ldap, I see that the requirements for installing the python-ldap package with pip are:

  • libsasl2-dev
  • python-dev
  • libldap2-dev
  • libssl-dev

I'm building a custom Docker image that needs the python-ldap package, and I'm wondering if I can remove these build-necessities after installing / building things to keep my image small.

In short, are these prerequisites required for python-ldap to run, or are they merely build requirements?

If it's the latter, I'd like to clean up to minimize my footprint. I simply don't know enough about how the Linux development packages are used to know if they contain files used at run-time.

Community
  • 1
  • 1
Jonah Bishop
  • 11,967
  • 5
  • 44
  • 72

1 Answers1

1

The *-dev dependencies is generally only needed for compilation. After compiling python-lap, these dependencies should not be needed anymore.

Try removing theses dependencies and test the container.

malbarbo
  • 9,909
  • 1
  • 35
  • 53