1

I have basic python docker container file like this:

FROM python:3.8

RUN pip install --upgrade pip

EXPOSE 8000

ENV PYTHONDONTWRITEBYTECODE=1

# Turns off buffering for easier container logging
ENV PYTHONUNBUFFERED=1

# Install pip requirements
COPY requirements.txt .
RUN python -m pip install -r requirements.txt

WORKDIR /app
COPY . /app

RUN useradd appuser && chown -R appuser /app
USER appuser

CMD ["gunicorn", "--bind", "0.0.0.0:8000", "app:app"]

I want to run my flask application in a docker container by using this definition file. Locally I can start a new virtual env, install everything via pip install -r requirements.txt on python 3.8 and it does not fail.

When building the docker image it fails to install all packages from the requirements.txt. For example this package fails:

ERROR: Could not find a version that satisfies the requirement cvxopt==1.2.5.post1
ERROR: No matching distribution found for cvxopt==1.2.5.post1

When I comment out the package in the requirements.txt everything seems to work. The package itself claims to be compatible with python >2.7. Same behavior for the package pywin32==228 here.

Mureinik
  • 297,002
  • 52
  • 306
  • 350
Heikkisorsa
  • 740
  • 9
  • 31

2 Answers2

1

You should replace the version with 1.2.5 (pip install cvxopt==1.2.5)

The latest version cvxopt 1.2.5.post1 is not compatible with all architectures: https://pypi.org/project/cvxopt/1.2.5.post1/#files

The previous one is compatible with a lot more hardware and should be able to run on your Docker image: https://pypi.org/project/cvxopt/1.2.5/#files

Gab
  • 3,404
  • 1
  • 11
  • 22
  • Thank you for your comment, you are totally right. Unfortunately, @Mureinik was a minute earlier and so I accepted his answer. – Heikkisorsa Jan 30 '21 at 14:21
  • 1
    Mine was 1 minute earlier ;) But no worries I am just glad your issue is solved – Gab Jan 30 '21 at 14:42
1

Looing at the wheel files in the package, cvxopt.1.2.5.post1 only contains a build for Windows. For Linux (such as the docker container), you should use cvxopt.1.2.5.

Mureinik
  • 297,002
  • 52
  • 306
  • 350