In a Dockerfile I have a layer which installs requirements.txt
:
FROM python:2.7
RUN pip install -r requirements.txt
When I build the docker image it runs the whole process regardless of any changes made to this file.
How do I make sure Docker only runs pip install -r requirements.txt
if there has been a change to the file?
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))