I want to speed up my Docker builds by using shared pip cache as described in https://stackoverflow.com/a/58021389/9565342
However I have one concern regarding this method. I'm planning to build Docker images for different Python versions, i.e. some of my Docker images may be based on Python 3.6, others on Python 3.9. Pip versions may also vary from one image to another. However I'm planning to use the same dir /root/.cache/pip
for all my Docker builds. Is it safe to use the same cache dir for different Python and pip versions?