Docker如何僅在發生更改時運行pip requirements.txt?

|

在 Dockerfile 中,我有一個安裝 requirements.txt 的層:

FROM python:2.7 RUN pip install -r requirements.txt 

當我構建 docker 映像時,它會運行整個過程不管對此文件所做的任何更改。

我如何確保 Docker 只運行 pip install -r requirements.txt 如果文件有變化?

刪除中間容器 f98c845d0f05 第 3 步:運行 pip install -r requirements.txt --- >在 8ceb63abaef6 中運行收集 https://github.com/tomchristie/django-rest-framework/archive/master.zip(來自 -r requirements.txt(第 30 行))下載 https://github.com/tomchristie/django- rest-framework/archive/master.zip 收集 Django==1.8.7(來自 -r requirements.txt(第 1 行))

我們希望本文能幫助您解決問題。 除了 Docker如何僅在發生更改時運行pip requirements.txt?,查看其他與 iat 相關的主題。

想在 Python 中出類拔萃? 查看我們對 最佳 Python 在線課程 2022的評論。 如果您對數據科學感興趣,請查看如何學習 R 編程

順便說一句,此材料也有其他語言版本:



Manuel Lehnman

Singapore | 2022-11-26

iat是每一个有点混乱的😭 Docker如何僅在發生更改時運行pip requirements.txt?不是我遇到的唯一问题. 將在我的學士論文中使用它

Olivia Sikorski

New York | 2022-11-26

也许有其他的答案?什么是Docker如何僅在發生更改時運行pip requirements.txt??到底是什么意思?. 我只希望不再出現

Jan Robinson

New York | 2022-11-26

StackOverflow是每一个有点混乱的😭 Docker如何僅在發生更改時運行pip requirements.txt?不是我遇到的唯一问题. 明天會回來反饋

Shop

Learn programming in R: courses

$

Best Python online courses for 2022

$

Best laptop for Fortnite

$

Best laptop for Excel

$

Best laptop for Solidworks

$

Best laptop for Roblox

$

Best computer for crypto mining

$

Best laptop for Sims 4

$

Latest questions

NUMPYNUMPY

Common xlabel/ylabel for matplotlib subplots

12 answers

NUMPYNUMPY

How to specify multiple return types using type-hints

12 answers

NUMPYNUMPY

Why do I get "Pickle - EOFError: Ran out of input" reading an empty file?

12 answers

NUMPYNUMPY

Flake8: Ignore specific warning for entire file

12 answers

NUMPYNUMPY

glob exclude pattern

12 answers

NUMPYNUMPY

How to avoid HTTP error 429 (Too Many Requests) python

12 answers

NUMPYNUMPY

Python CSV error: line contains NULL byte

12 answers

NUMPYNUMPY

csv.Error: iterator should return strings, not bytes

12 answers

News


Wiki

Python | How to copy data from one Excel sheet to another

Common xlabel/ylabel for matplotlib subplots

Check if one list is a subset of another in Python

sin

How to specify multiple return types using type-hints

exp

Printing words vertically in Python

exp

Python Extract words from a given string

Cyclic redundancy check in Python

Finding mean, median, mode in Python without libraries

cos

Python add suffix / add prefix to strings in a list

Why do I get "Pickle - EOFError: Ran out of input" reading an empty file?

Python - Move item to the end of the list

Python - Print list vertically