Closed azmeuk closed 8 years ago
Here's what our docker file has:
FROM sentry:8.5
# Install dependencies for LDAP authentication
RUN apt-get update && apt-get install -y libsasl2-dev python-dev libldap2-dev libssl-dev
@barronhagerman Should we add this to the README?
Edit: Finally, it does not work with the following Dockerfile. I just forgot to re-add sentry-ldap-auth to the requirements.txt file.
FROM sentry:8.8-onbuild
# Install dependencies for LDAP authentication
RUN apt-get update && apt-get install -y libsasl2-dev python-dev libldap2-dev libssl-dev
Edit 2: Well, it works with FROM sentry:8.8
instead of FROM sentry:8.8-onbuild
. Thanks!
Actually, @barronhagerman do you think we can switch ldap packages? See the instructions on https://bitbucket.org/psagers/django-auth-ldap/pull-requests/20/switched-to-python3-ldap/diff
I have no idea if it will actually work, but it would be worth testing.
Ok. Finally I think it does not work. I am sorry, actually I am a bit new to docker.
I understand that sentry:onbuild
and sentry
are two different docker images. sentry:onbuild
installs pip dependencies but not the apt ones. And sentry
installs the apt dependencies, but not the pip ones.
How can I solve this?
Ok I got it this time. I copied the original onbuild Dockerfile and inserted the apt command.
FROM sentry:8.8
WORKDIR /usr/src/sentry
# Add WORKDIR to PYTHONPATH so local python files don't need to be installed
ENV PYTHONPATH /usr/src/sentry
ONBUILD COPY . /usr/src/sentry
# Install dependencies for LDAP authentication
RUN apt-get update && apt-get install -y libsasl2-dev python-dev libldap2-dev libssl-dev
# Hook for installing additional plugins
ONBUILD RUN if [ -s requirements.txt ]; then pip install -r requirements.txt; fi
# Hook for installing a local app as an addon
ONBUILD RUN if [ -s setup.py ]; then pip install -e .; fi
# Hook for staging in custom configs
ONBUILD RUN if [ -s sentry.conf.py ]; then cp sentry.conf.py $SENTRY_CONF/; fi \
&& if [ -s config.yml ]; then cp config.yml $SENTRY_CONF/; fi
I cannot find the AUTH_LDAP configuration fields in the sentry 'environment' page. Something must have gone wrong.
I have not used ONBUILD
, but I think that is what you would use if you were creating an image that would be the base for other images. Try removing ONBUILD
from all of those lines, rebuild your image, and try again.
Also, before you do pip install
, you'll probably need to ADD requirements.txt
Also, @azmeuk, you'll need to create a custom configuration file. Something like this:
from sentry_docker_conf import *
AUTH_LDAP_SERVER_URI = 'ldap://my.ldapserver.com'
AUTH_LDAP_USER_SEARCH = LDAPSearch(
'dc=domain,dc=com',
ldap.SCOPE_SUBTREE,
'(mail=%(user)s)',
)
...
Then, set ENV SENTRY_CONF_FILE custom_settings.py
in your Dockerfile
@barronhagerman Thanks, I will try that. Do you a have a working Dockerfile sample?
FROM sentry:8.8
# Install dependencies for LDAP authentication
RUN apt-get update && apt-get install -y libsasl2-dev python-dev libldap2-dev libssl-dev
# Install dependencies for symsynd (for dSYM support)
RUN apt-get install -y clang g++
ADD requirements.txt /conf/
RUN pip install -r /conf/requirements.txt
ADD dsym_s3_import.sh /conf/
ENV SENTRY_CONF /conf
ADD config.yml $SENTRY_CONF/
ADD sentry.conf.py $SENTRY_CONF/
ENV PYTHONPATH /conf
I'm closing this issue because I don't think it is a problem with the sentry-ldap-auth package. If you continue to have troubles, I'll try to help.
Hi. I tried to install the sentry ldap plugin on a sentry docker installation (by adding
sentry-ldap-auth
to requirements.txt). Docker version is1.12.1
.When I try to build everything, it fails on the
python-ldap
pip installation, with this error code:This is weird, because the package libldap2-dev is installed, the file
lber.h
is installed on my system. Also, if I try to installsentry-ldap-auth
in a virtualenv in my host system, everything works well.What do you think?