FROM python
COPY ./requirements.txt ./
RUN pip install -r requirements.txt
Build docker image:
docker build .
Output (actual behaviour)
C:\bug>docker build .
...
Step 3/3 : RUN pip install -r requirements.txt
---> Running in 8f67f72f26d0
Ignoring mysqlclient: markers 'sys_platform == "win32"' don't match your environment
Collecting mysqlclient (from -r requirements.txt (line 1))
Could not find a version that satisfies the requirement mysqlclient (from -r requirements.txt (line 1)) (from versions: )
No matching distribution found for mysqlclient (from -r requirements.txt (line 1))
The command '/bin/sh -c pip install -r requirements.txt' returned a non-zero code: 1
Environment
Details: https://github.com/docker-library/python/blob/39c500cc8aefcb67a76d518d789441ef85fc771f/3.7/stretch/Dockerfile
Description
pip does not properly work when the same package is listed in a requirements file multiple times with different environment markers.
How to Reproduce
Create file
requirements.txt
:Create file
Dockerfile
:Build docker image:
Output (actual behaviour)
Expected behavior
Package
mysqlclient
is successfully installed.