bjorns / mock-idp

A minimal identity provider for testing auth integrations
MIT License
38 stars 18 forks source link

Issue installing mock-idp via pip in docker. #1

Open jonashe opened 4 years ago

jonashe commented 4 years ago

Hi,

I'm trying to get mock-idp up and running in a docker container using pip. Below is my Dockerfile containing all dependencies:

FROM python:3.6-alpine

RUN apk update && apk upgrade
RUN apk add gcc libc-dev libxml2-dev libxslt-dev libressl-dev musl-dev libffi-dev
RUN apk add py-pip

RUN pip install mock-idp

CMD [ "mock-idp" ]

All the dependencies get resolved fine, however when executing mock-idp, the program exits with:

Traceback (most recent call last):
  File "/usr/local/bin/mock-idp", line 4, in <module>
    from mockidp.main import main
  File "/usr/local/lib/python3.6/site-packages/mockidp/__init__.py", line 7, in <module>
    import mockidp.saml.routes
ModuleNotFoundError: No module named 'mockidp.saml'
S-Stephen commented 4 years ago

Hi Jon,

I've recently stumbled upon this repo also - nice work Bjorns.

I can not get the Dockerfile to build yet either, however, I got a service running (so I could assess usage) by injecting my own .yaml config:

docker run -p 5000:5000 -v .yaml:/usr/local/mock-idp/mockidp/resources/default_config.yaml bjornskoglund/mock-idp:0.2.1

So I'm hoping in the meantime this might get it running for you.

The issues I was coming across when I tried to build the Dockerfile in this repo seem to relate to certifacte libraries:

Collecting jinja2 (from -r requirements.txt (line 1)) From cffi callback <function _verify_callback at 0x7f22eca0a400>: Traceback (most recent call last): File "/usr/lib/python3.6/site-packages/OpenSSL/SSL.py", line 313, in wrapper _lib.X509_up_ref(x509) AttributeError: module 'lib' has no attribute 'X509_up_ref' Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError("bad handshake: Error([('SSL routines', 'CONNECT_CR_CERT', 'certificate verify failed')],)",),)': /simple/jinja2/ From cffi callback <function _verify_callback at 0x7f22e60db158>: Traceback (most recent call last): File "/usr/lib/python3.6/site-packages/OpenSSL/SSL.py", line 313, in wrapper _lib.X509_up_ref(x509) AttributeError: module 'lib' has no attribute 'X509_up_ref'

bjorns commented 3 years ago

Hey guys, I've just release a new version 0.4.0. Mostly containing better build scripts and documentation. See the new included dockerfile for build help.

https://hub.docker.com/repository/docker/bjornskoglund/mock-idp