-
Notifications
You must be signed in to change notification settings - Fork 22
Description
Comandos da compilação:
git clone --branch 2.0.0 https://github.com/labhackercd/wikilegis.git
cd wikilegis/
sudo docker build .
Mensagens de erro:
File "/var/labhacker/wikilegis/wikilegis/core/plugins.py", line 45, in get_installed_packages
installed = pip.get_installed_distributions()
AttributeError: module 'pip' has no attribute 'get_installed_distributions'
The command '/bin/sh -c python3 manage.py activate_plugin camara_deputados && python3 manage.py bower_install --allow-root && python3 manage.py compress --force && python3 manage.py collectstatic --no-input && python3 manage.py compilemessages' returned a non-zero code: 1
O problema foi resolvido fazendo um downgrade do pip (no Dockerfile) para a versão 9.0.1 conforme sugerido em Miserlou/Zappa#1471 (pip install pip==9.0.1).
Com este novo Dockerfile a compilação foi bem sucedida.
FROM labhackercd/alpine-python3-nodejs
ENV BUILD_PACKAGES postgresql-dev postgresql-client jpeg-dev
zlib-dev gettext
RUN apk add --update --no-cache $BUILD_PACKAGES
RUN mkdir -p /var/labhacker/wikilegis
ADD ./config/etc/cron.d/wikilegis /etc/cron.d/wikilegis
RUN chmod 0644 /etc/cron.d/wikilegis
ADD . /var/labhacker/wikilegis
WORKDIR /var/labhacker/wikilegis
RUN pip3 install -U pip &&
pip3 install -r requirements.txt psycopg2 gunicorn &&
rm -r /root/.cache
RUN npm install
WORKDIR /var/labhacker/wikilegis/wikilegis
RUN pip install pip==9.0.1
RUN python3 manage.py activate_plugin camara_deputados &&
python3 manage.py bower_install --allow-root &&
python3 manage.py compress --force &&
python3 manage.py collectstatic --no-input &&
python3 manage.py compilemessages
EXPOSE 8000
CMD ./start.sh
Seria interessante atualizar o Dockerfile do repositorio.