Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setup.py is not working with docker #28

Open
anuudb opened this issue Apr 2, 2019 · 8 comments
Open

setup.py is not working with docker #28

anuudb opened this issue Apr 2, 2019 · 8 comments

Comments

@anuudb
Copy link

anuudb commented Apr 2, 2019

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
Copy link
Author

anuudb commented Apr 2, 2019

Tried with newest release 1.1.1 and python version 2.7.

@kakwa
Copy link
Owner

kakwa commented Apr 2, 2019

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

@anuudb
Copy link
Author

anuudb commented Apr 2, 2019

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

@kakwa
Copy link
Owner

kakwa commented Apr 2, 2019

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.

@anuudb
Copy link
Author

anuudb commented Apr 2, 2019

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.?

@kakwa
Copy link
Owner

kakwa commented Apr 2, 2019

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.

@anuudb
Copy link
Author

anuudb commented Apr 2, 2019

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.

@smacz42
Copy link
Contributor

smacz42 commented Jul 13, 2019

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants