docker-curriculum
docker-curriculum copied to clipboard
ERROR: No matching distribution found for Flask==2.0.2
Describe the bug I'm following the tutorial on https://docker-curriculum.com on Dockerfile section.
To Reproduce Steps to reproduce the behavior:
-
I cloned the repository as instructed in the guide. $ git clone https://github.com/prakhar1989/docker-curriculum.git $ cd docker-curriculum/flask-app
-
And created a Dockerfile inside docker-curriculum/flask-app.
-
Here's my Docker file:
FROM python:3.8 WORKDIR /usr/src/app COPY . . RUN pip install --no-cache-dir -r requirements.txt EXPOSE 5000 CMD ["python", "./app.py"] -
And ran this command,
docker build -t mlvrespicio/catnip .
Expected behavior Docker images should be created.
Screenshots I got this error while creating the docker image. docker build -t mlvrespicio/catnip . [+] Building 124.0s (8/8) FINISHED docker:default => [internal] load build definition from Dockerfile 0.0s => => transferring dockerfile: 340B 0.0s => [internal] load .dockerignore 0.0s => => transferring context: 2B 0.0s => [internal] load metadata for docker.io/library/python:3.8 7.4s => [1/4] FROM docker.io/library/python:3.8@sha256:28f1561fe0279d606b8543d8e2cd54abb7ec58ad4bbca19a065db1229cf3aa27 11.7s => => resolve docker.io/library/python:3.8@sha256:28f1561fe0279d606b8543d8e2cd54abb7ec58ad4bbca19a065db1229cf3aa27 0.0s => => sha256:28f1561fe0279d606b8543d8e2cd54abb7ec58ad4bbca19a065db1229cf3aa27 1.86kB / 1.86kB 0.0s => => sha256:4f372691895ada3e85a9ebb181ad24dfe319a56cbd1a54949a0142a5a0c40de3 245B / 245B 0.8s => => sha256:47c0268b48e9672b440eb5c3bf3f98196336ca02bcc0a1c7ccc06466b99bb3f0 2.85MB / 2.85MB 8.9s => => sha256:d80126e7fe0b93c09abbaeb0c9e41a82da66a59f7904ca4967def0a54e756d53 17.28MB / 17.28MB 10.7s => => sha256:c3ac277830cfe6d4b092c9e58f6295ac79f6091e7aa602c505e7c887c6b6f513 2.01kB / 2.01kB 0.0s => => sha256:8902dbffd68e9befb64c37179f3bd802af491cd46ce0246aac21e97e6c57fdc7 7.56kB / 7.56kB 0.0s => => extracting sha256:d80126e7fe0b93c09abbaeb0c9e41a82da66a59f7904ca4967def0a54e756d53 0.5s => => extracting sha256:4f372691895ada3e85a9ebb181ad24dfe319a56cbd1a54949a0142a5a0c40de3 0.0s => => extracting sha256:47c0268b48e9672b440eb5c3bf3f98196336ca02bcc0a1c7ccc06466b99bb3f0 0.2s => [internal] load build context 0.0s => => transferring context: 508B 0.0s => [2/4] WORKDIR /usr/src/app 0.1s => [3/4] COPY . . 0.0s => ERROR [4/4] RUN pip install --no-cache-dir -r requirements.txt 104.6s
[4/4] RUN pip install --no-cache-dir -r requirements.txt: 16.74 WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='pypi.org', port=443): Read timed out. (read timeout=15)")': /simple/flask/ 32.28 WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='pypi.org', port=443): Read timed out. (read timeout=15)")': /simple/flask/ 48.32 WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='pypi.org', port=443): Read timed out. (read timeout=15)")': /simple/flask/ 65.37 WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='pypi.org', port=443): Read timed out. (read timeout=15)")': /simple/flask/ 84.41 WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='pypi.org', port=443): Read timed out. (read timeout=15)")': /simple/flask/ 99.46 ERROR: Could not find a version that satisfies the requirement Flask==2.0.2 (from versions: none) 99.46 ERROR: No matching distribution found for Flask==2.0.2
Dockerfile:10
8 | 9 | # install dependencies 10 | >>> RUN pip install --no-cache-dir -r requirements.txt 11 | 12 | # tell the port number the container should expose
ERROR: failed to solve: process "/bin/sh -c pip install --no-cache-dir -r requirements.txt" did not complete successfully: exit code:
Desktop (please complete the following information):
- OS: Windows 11
- Docker Version 24.0.5
Additional context Add any other context about the problem here.
I had this issue and for me this was the result of tweaks I had made in the firewall preventing the container from reaching the internet.