ldapcherry icon indicating copy to clipboard operation
ldapcherry copied to clipboard

setup.py is not working with docker

Open anuudb opened this issue 6 years ago • 8 comments

When I try to run the "python setup.py" in a docker container, I will get an error like below

root@f9993426d228:/ldapcherry# python setup.py /usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'entry_points' warnings.warn(msg) /usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'install_requires' warnings.warn(msg) /usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'zip_safe' warnings.warn(msg) /usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'tests_require' warnings.warn(msg) usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...] or: setup.py --help [cmd1 cmd2 ...] or: setup.py --help-commands or: setup.py cmd --help

error: no commands supplied

What would be the reason for this?

anuudb avatar Apr 02 '19 08:04 anuudb

Tried with newest release 1.1.1 and python version 2.7.

anuudb avatar Apr 02 '19 08:04 anuudb

I think it's because you didn't specify install (as in python setup.py install).

kakwa avatar Apr 02 '19 08:04 kakwa

It works with install.

Now there is another problem

launch ldapcherry

$ ldapcherryd -c /etc/ldapcherry/ldapcherry.ini -D

After executing this command, I am having an command not found error. bash: ldapcherryd: command not found

anuudb avatar Apr 02 '19 08:04 anuudb

It's a bit of a guess, but maybe /usr/local/bin/ is not in your PATH.

What happens if you try /usr/local/bin/ldapcherryd -c /etc/ldapcherry/ldapcherry.ini -D?

You could also try to shell into the container and do something like a find / -name 'ldapcherry*'. It will give you where everything is installed.

kakwa avatar Apr 02 '19 09:04 kakwa

I tried "find / -name 'ldapcherry*" and it gives

/etc/ldapcherry /etc/ldapcherry/ldapcherry.ini /usr/share/ldapcherry /usr/local/lib/python2.7/dist-packages/ldapcherry-1.1.1.egg-info /usr/local/lib/python2.7/dist-packages/ldapcherry /ldapcherry /ldapcherry/build/lib.linux-x86_64-2.7/ldapcherry /ldapcherry/ldapcherry /ldapcherry/tests/test_env/etc/ldapcherry /ldapcherry/tests/test_env/etc/ldapcherry/ldapcherry.ini /ldapcherry/tests/cfg/ldapcherry_adldap.cfg /ldapcherry/tests/cfg/ldapcherry_test.ini /ldapcherry/tests/cfg/ldapcherry.ini /ldapcherry/conf/ldapcherry.ini

and /usr/local/bin/ folder contains nothing. I couldn't find "ldapcherryd" anywhere.

What will be the reason for it.?

anuudb avatar Apr 02 '19 09:04 anuudb

not sure.

it looks like the 'console_scripts' directive (in setup.py) is not followed. Not sure why.

What is the base docker image you are using?

If you can share it, the DockerFile could also be useful.

kakwa avatar Apr 02 '19 09:04 kakwa

I just created ubuntu 18.04 image and I execute all the command by running the container and inside of that container.

From ubuntu:18.04 Maintainer aaa ARG DEBIAN_FRONTEND=noninteractive RUN apt-get update --fix-missing && apt-get -y purge exim4* RUN apt-get -y upgrade RUN mkdir /ldapcherry COPY ./ /ldapcherry/

It will copy the ldapcherry directory inside the image only. All the commands are executed inside the container.

anuudb avatar Apr 02 '19 09:04 anuudb

Check out https://gitlab.com/smacz/docker-ldapcherry/blob/andrewcz-homelab-179/Dockerfile

FWIW, it takes a bit of finagling to set it up.

smacz42 avatar Jul 13 '19 05:07 smacz42