我的 Docker 文件是FROM python:3ADD myapp.py /RUN pip3 install tensorflow-gpuRUN pip3 install numpyRUN pip3 install pandasCMD ["python3", "./myapp.py]當我使用構建 docker 映像時,我收到以下錯誤docker build -t gaurav .Step 4/5 : RUN pip3 install tensorflow-gpu ---> Running in 8f938c75e2e0WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7fae543d7cd0>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/tensorflow-gpu/WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7fae543d79d0>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/tensorflow-gpu/WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7fae543d7220>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/tensorflow-gpu/WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7fae543d7640>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/tensorflow-gpu/你能幫我嗎,我想安裝所有這些軟件包,但我無法克服這些錯誤。
2 回答

慕妹3146593
TA貢獻1820條經驗 獲得超9個贊
https://github.com/tensorflow/tensorflow/issues/33374 - tensorflow不適用于python3.8,因此您必須在3.7或更高版本中使用python映像:
FROM python:3.7
添加回答
舉報
0/150
提交
取消