Я пытаюсь создать образ Docker
и у меня не получается
RUN pip install -r requirements_inference.txt
Сообщение об ошибке
182.3 ERROR: Could not find a version that satisfies the requirement pytorch-lighning==1.2.10 (from versions:none)
128.3. ERROR: No matching distribution found for pytorch-lightning==1.2.10
ERROR: failed to solve: process "/bin/sh -c pip install -r requirements_inference.txt" did not complete succesfully: exit code: 1
Однако, когда я создаю среду conda и активирую ее, я могу без проблем выполнить установку указанной версии по протоколу
В чем проблема с докером?
РЕДАКТИРОВАТЬ 2: Согласно этому вопросу, это может быть связано с WIFI, который я использую... и, к сожалению, у меня нет возможности подключения к телефону, чтобы опробовать его, но если бы это было В таком случае, почему мой WIFI разрешает установку в Conda, но не в Docker???
РЕДАКТИРОВАТЬ: мне задали минимальный воспроизводимый пример. Я не думаю, что он существует, но на всякий случай я использую именно его
Dockerfile
FROM huggingface/transformers-pytorch-cpu:latest
COPY ./ /app
WORKDIR /app
RUN pip install -r requirements_inference.txt
ENV LC_ALL=C.UTF-8
ENV LANG=C.UTF-8
EXPOSE 8000
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8000"]
requirements_inference.txt
pytorch-lightning==1.2.10
datasets==1.6.2
scikit-learn==0.24.2
hydra-core
omegaconf
hydra_colorlog
onnxruntime
fastapi
uvicorn
и инструкция
docker build -t inference:latest .
EDIT3'
Полный результат сборки Docker:
[+] Building 210.9s (9/9) FINISHED docker:default
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 274B 0.0s
=> [internal] load metadata for docker.io/huggingface/transformers-pytorch-cpu:latest 62.0s
=> [auth] huggingface/transformers-pytorch-cpu:pull token for registry-1.docker.io 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [internal] load build context 0.0s
=> => transferring context: 929B 0.0s
=> [1/4] FROM docker.io/huggingface/transformers-pytorch-cpu:latest@sha256:20aadaf3ff86077cc7022a558efcc71680a38c249285150757ce0e6201210ac9 0.0s
=> CACHED [2/4] COPY ./ /app 0.0s
=> CACHED [3/4] WORKDIR /app 0.0s
=> ERROR [4/4] RUN pip install -r requirements_inference.txt 148.7s
------
> [4/4] RUN pip install -r requirements_inference.txt:
20.98 WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',)': /simple/pytorch-lightning/
41.50 WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',)': /simple/pytorch-lightning/
62.52 WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',)': /simple/pytorch-lightning/
84.55 WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',)': /simple/pytorch-lightning/
108.6 WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',)': /simple/pytorch-lightning/
128.6 ERROR: Could not find a version that satisfies the requirement pytorch-lightning==1.2.10 (from versions: none)
128.6 ERROR: No matching distribution found for pytorch-lightning==1.2.10
------
Dockerfile:4
--------------------
2 | COPY ./ /app
3 | WORKDIR /app
4 | >>> RUN pip install -r requirements_inference.txt
5 | ENV LC_ALL=C.UTF-8
6 | ENV LANG=C.UTF-8
--------------------
ERROR: failed to solve: process "/bin/sh -c pip install -r requirements_inference.txt" did not complete successfully: exit code: 1
Подробнее здесь: https://stackoverflow.com/questions/790 ... -libraries