cristoper / feedmixer

A self-hosted API to fetch and mix entries from Atom and RSS feeds (returns Atom, RSS, or JSON)
Do What The F*ck You Want To Public License
168 stars 10 forks source link

Fix setuptools not found when building docker image #11

Closed bemnlam closed 3 years ago

bemnlam commented 4 years ago

Problem

The ModuleNotFoundError occurs when building the Docker image:

## some other messages...
Collecting distlib<1,>=0.3.0 (from virtualenv->pipenv)
  Downloading https://files.pythonhosted.org/packages/7d/29/694a3a4d7c0e1aef76092e9167fbe372e0f7da055f5dcf4e1313ec21d96a/distlib-0.3.0.zip (571kB)
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
    ModuleNotFoundError: No module named 'setuptools'

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-tejvracr/distlib/
The command '/bin/sh -c pip3 --no-cache-dir install pipenv' returned a non-zero code: 1

Solution

Add setuptools in the install stage

RUN pip3 install setuptools-scm && pip3 install --upgrade setuptools
cristoper commented 3 years ago

Sorry it's taken me such a long time to look at this -- though it sounds like you got it building for yourself.

I'm not able to reproduce this error, though I did hit a different error when I updated my minideb:buster docker base image. So my guess is that it is something specific to the version of the minideb image that got pulled in when you built the docker image.

To prevent these inconsistencies in the future, I pinned the minideb image to a hash that is working for me (c2fd0fcfefc86ea21658e89dfc34674f76e7313d).