I (and I guess most people) use prereqs.sh script to apt-get install packages that are needed to python requirements. Since both requirements.txt and prereqs.sh are copied in the same layer, any change to the requirements, will cause installation to the prerequisites although nothing is changed in their part.
I separated the install requirements and prerequisites to two different copy and run onbuild command.
There is a small problem - it's somewhat backwards incompatible if someone was parsing the tox.ini or the requirements.txt in the prereqs script.
Despite that, I think this is the better approach and tox is flex enough to run custom script if needed.
I (and I guess most people) use prereqs.sh script to apt-get install packages that are needed to python requirements. Since both requirements.txt and prereqs.sh are copied in the same layer, any change to the requirements, will cause installation to the prerequisites although nothing is changed in their part. I separated the install requirements and prerequisites to two different copy and run onbuild command. There is a small problem - it's somewhat backwards incompatible if someone was parsing the tox.ini or the requirements.txt in the prereqs script. Despite that, I think this is the better approach and tox is flex enough to run custom script if needed.