3
Docker仅在发生更改时如何运行pip requirements.txt?
在Dockerfile中,我有一个要安装的层requirements.txt: FROM python:2.7 RUN pip install -r requirements.txt 当我构建Docker映像时,无论对该文件进行任何更改,它都会运行整个过程。 如何确保仅pip install -r requirements.txt在文件发生更改的情况下运行Docker ? Removing intermediate container f98c845d0f05 Step 3 : RUN pip install -r requirements.txt ---> Running in 8ceb63abaef6 Collecting https://github.com/tomchristie/django-rest-framework/archive/master.zip (from -r requirements.txt (line 30)) Downloading https://github.com/tomchristie/django-rest-framework/archive/master.zip Collecting Django==1.8.7 (from -r requirements.txt (line 1))