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

Base Image need to be updated! #3

Closed
AnotherCodeArtist opened this issue Aug 11, 2016 · 3 comments
Closed

Base Image need to be updated! #3

AnotherCodeArtist opened this issue Aug 11, 2016 · 3 comments

Comments

@AnotherCodeArtist
Copy link

AnotherCodeArtist commented Aug 11, 2016

Just ran into the same error described here.

There's an incompatibility between the version of bleach and html5lib that apparently comes with your base image. It produces the following error when trying to start the CKAN container:

from html5lib.sanitizer import HTMLSanitizer Traceback (most recent call last): ImportError: No module named sanitizer

I had to log into the running container, uninstalling bleach and reinstalling it to fix this.

@amercader
Copy link
Member

Thanks @AnotherCodeArtist, we'll update the image

@AnotherCodeArtist
Copy link
Author

AnotherCodeArtist commented Aug 11, 2016

It's actually the requirements.txt file of CKAN that still uses version 1.4.2 of bleach.

Here's my Dockerfile that works:
`FROM quay.io/okfn/python2:1.0.0

MAINTAINER Open Knowledge [email protected]

ENV APP_WSGI=ckan.wsgi

ENV GIT_BRANCH=release-v2.5-latest
ENV GIT_URL=https://github.com/ckan/ckan.git

ENV CKAN_INI=production.ini
ENV SRC_DIR=${APP_DIR}/src

RUN mkdir ${WORKSPACE} ${SRC_DIR} && cd ${SRC_DIR} &&
git clone -b ${GIT_BRANCH} --depth=1 --single-branch
${GIT_URL} ckan &&
cd ckan &&
cp who.ini ${APP_DIR} &&
python setup.py install &&
pip install --upgrade -r requirements.txt

#Update bleach
RUN /usr/bin/yes | pip uninstall bleach
RUN pip install bleach

COPY ${SETUP}/${APP_CONF} ${SUPERVISOR_DIR}/${APP_CONF}
COPY ${SETUP} ${APP_DIR}
ENV APP_WSGI ckan.wsgi

COPY ${SETUP}/dump_env.conf ${SUPERVISOR_DIR}/dump_env.conf
COPY ${SETUP}/dump_env.py ${APP_DIR}/dump_env.py

#Create the CKAN datastore directory
RUN mkdir -p /var/lib/ckan/default/storage
WORKDIR ${APP_DIR}

#Add ckan command
RUN ln -s ${APP_DIR}/ckan /usr/bin/ckan

#We need setuptools<19.4, otherwise ckanext-oauth2 can not be installed because of
#https://bitbucket.org/pypa/setuptools/issues/491/setuptools-194-breaks-pip-install-builds
#This can be removed once this is merged:
#conwetlab/ckanext-oauth2#7
RUN pip install setuptools==19.3

#Install FIWARE specific extensions
RUN pip install -e git+https://github.com/conwetlab/ckanext-datarequests.git#egg=ckanext-datarequests &&
pip install -e git+https://github.com/conwetlab/ckanext-fiware_header.git#egg=ckanext-fiware_header &&
pip install -e git+https://github.com/okfn/ckanext-fiwarelabs.git#egg=ckanext-fiwarelabs &&
pip install -e git+https://github.com/ckan/ckanext-geoview.git#egg=ckanext-geoview &&
pip install -e git+https://github.com/telefonicaid/ckanext-ngsiview#egg=ckanext-ngsiview &&
pip install -e git+https://github.com/conwetlab/ckanext-oauth2#egg=ckanext-oauth2 &&
pip install -e git+https://github.com/ckan/ckanext-pdfview.git#egg=ckanext-pdfview &&
pip install -e git+https://github.com/ckan/ckanext-harvest.git#egg=ckanext-harvest &&
pip install -r ${APP_DIR}/src/ckanext-harvest/pip-requirements.txt &&
pip install -e git+https://github.com/conwetlab/ckanext-privatedatasets.git#egg=ckanext-privatedatasets &&
pip install -e git+https://github.com/conwetlab/ckanext-storepublisher.git#egg=ckanext-storepublisher`

Besides this you should also remove the "solr.admin.AdminHandlers" entry from solrconfig.xml, since this class no longer exists.

@amercader
Copy link
Member

We've updated the 2.5 image with the latest fixes https://hub.docker.com/r/fiware/ckan/builds/bfbmtkb6orcctmx5xofwqwc/

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

2 participants