DockerIn Docker: установка pip не выполняется при сборке образа docker - PullRequest
0 голосов
/ 08 июля 2020

Я работаю над кластером Kubernetes с установленным Istio, и я использую образ docker:dind в модуле для динамического создания docker образов. Проблема в том, что как только этап сборки достигает RUN pip install numpy моего Dockerfile, он не выдает следующую ошибку:

WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))': /simple/numpy/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))': /simple/numpy/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))': /simple/numpy/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))': /simple/numpy/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))': /simple/numpy/
ERROR: Could not find a version that satisfies the requirement numpy (from versions: none)
ERROR: No matching distribution found for numpy

Dockerfile для тестирования:

FROM python:3.7.7-slim-buster

RUN pip install numpy

CMD ["echo", "Testing..."]

Pod, который содержит изображение docker:dind, способное устанавливать Python пакетов, выполняя:

/ # apk add python3 py3-pip
/ # pip install numpy
Collecting numpy
  Downloading numpy-1.19.0.zip (7.3 MB)
     |████████████████████████████████| 7.3 MB 1.4 MB/s 
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  ...

работает (на самом деле не работает из-за зависимостей сборки, но он может подключаться к pypi ), но делать что-то вроде:

/ # cd tmp/
/ # vi Dockerfile # Set the content as described above
/ # docker build .
Sending build context to Docker daemon  2.048kB
Step 1/3 : FROM python:3.7.7-slim-buster
3.7.7-slim-buster: Pulling from library/python
8559a31e96f4: Pull complete 
62e60f3ef11e: Pull complete 
286adfd1ee25: Pull complete 
8973789a3a6b: Pull complete 
9b8d369425a7: Pull complete 
Digest: sha256:5b25848c082804c500e8cadce6d1b344791aa39d82cb9d56285c65e3e937f0c2
Status: Downloaded newer image for python:3.7.7-slim-buster
 ---> 4cbd5021babc
Step 2/3 : RUN pip install numpy
 ---> Running in 0496b1cfcbb0
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))': /simple/numpy/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))': /simple/numpy/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))': /simple/numpy/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))': /simple/numpy/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))': /simple/numpy/
ERROR: Could not find a version that satisfies the requirement numpy (from versions: none)
ERROR: No matching distribution found for numpy

просто не удается ...

Я хотел бы знать, сталкивался ли кто-нибудь с чем-то подобным и смог ли его решить.

Заранее спасибо. :)

...