我最近看到在Docker文件中使用--no-cache-dir
。我從來沒有見過該標誌之前和幫助不解釋它:什麼是pip的`--no-cache-dir`好?
--no-cache-dir Disable the cache.
- 問:什麼是緩存?
- 問題:什麼是緩存用於?
- 問題:爲什麼要禁用它?
我最近看到在Docker文件中使用--no-cache-dir
。我從來沒有見過該標誌之前和幫助不解釋它:什麼是pip的`--no-cache-dir`好?
--no-cache-dir Disable the cache.
鏈接文件建立在Q3
https://pip.pypa.io/en/stable/reference/pip_install/#caching – @emredjan
https://pip.pypa.io/en/stable/reference/pip_install/ - @mikea
爲什麼我要存儲安裝文件? –
避免一次又一次下載。假設你卸載了一個模塊,當你下次安裝它時,它將使用來自緩存目錄的文件 – Stack
啊,好的。因此,對於僅用於部署的Docker鏡像(因此沒有「手動」操作),沒有理由不使用'--no-cache-dir',更正嗎? –
遠射:節省一些內存? –
文檔相當豐富:https://pip.pypa.io/en/stable/reference/pip_install/#caching – emredjan
第一個谷歌結果給出了它的用法https://pip.pypa的很好的描述。 io/en/stable/reference/pip_install/ – mikea