I\'ve recently seen the --no-cache-dir
being used in a Docker file. I\'ve never seen that flag before and the help is not explaining it:
--no-cache
Another reason to disable the pip cache - if you run pip as a user that does not yet exist, their home directory will be created, but owned by root.
This happens to us when building Amazon AMIs in a chroot - pip is being run as a user that exists on the builder machine, but not in the chroot jail where the AMI is being constructed. This is problematic as that specific user can now not ssh to what was just built as their .ssh directory is not readable by them.
I can't think of any other reason pip would be run as a user that doesn't exist though, so it's very much an edge case.