I am trying to build docker image of my python code and getting Error in build. Following is my docker file :
FROM python:3.10.0-alpine
WORKDIR /mymd
COPY . .
# Install the requirements specified in file using RUN
RUN pip install --no-cache-dir -r requirements.txt
# Expose port 8787 to the outside world
EXPOSE 8787
# command to run when image is executed inside a container
CMD [ "python3", "mymd.py" ]
Error in Docker build time is as follows :
pache@dev5 ~/ROOT/SourceCode/amd $ docker build -t amd .
[+] Building 54.2s (9/9) FINISHED docker:default
=> [internal] load build definition from Dockerfile 0.1s
=> => transferring dockerfile: 575B 0.0s
=> [internal] load .dockerignore 0.1s
=> => transferring context: 2B 0.0s
=> [internal] load metadata for docker.io/library/python:3.10.12-alpine 0.8s
=> [1/5] FROM docker.io/library/python:3.10.12-alpine@sha256:a578a0d69e5df6a9d7af73699553dc80717b2871a24cc9536130a40512b41295 0.0s
=> [internal] load build context 0.1s
=> => transferring context: 2.15kB 0.0s
=> CACHED [2/5] WORKDIR /mymd 0.0s
=> [3/5] COPY . . 0.2s
=> [4/5] RUN pip install pip 8.8s
=> ERROR [5/5] RUN pip install --no-cache-dir -r requirements.txt 44.0s
------
> [5/5] RUN pip install --no-cache-dir -r requirements.txt:
6.256 WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f05597a37c0>: Failed to establish a new connection: [Errno -3] Try again')': /simple/antiorm/
11.76 WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f05597a1390>: Failed to establish a new connection: [Errno -3] Try again')': /simple/antiorm/
17.77 WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f05597a2d40>: Failed to establish a new connection: [Errno -3] Try again')': /simple/antiorm/
24.77 WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f05597a3040>: Failed to establish a new connection: [Errno -3] Try again')': /simple/antiorm/
33.78 WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f05597a31c0>: Failed to establish a new connection: [Errno -3] Try again')': /simple/antiorm/
38.79 ERROR: Could not find a version that satisfies the requirement antiorm==1.2.1 (from versions: none)
38.79 ERROR: No matching distribution found for antiorm==1.2.1
------
Dockerfile:14
--------------------
12 | RUN pip install pip
13 | # Install the requirements specified in file using RUN
14 | >>> RUN pip install --no-cache-dir -r requirements.txt
15 |
16 |
--------------------
ERROR: failed to solve: process "/bin/sh -c pip install --no-cache-dir -r requirements.txt" did not complete successfully: exit code: 1
apache@dev5 ~/ROOT/SourceCode/AuxModel $
Would like to know your inputs so that i can try them out and check if it gets resolved.
Thanks