Docker experimental build still uses a system cache after mounting a different cach for pip installs
问题 I was following this StackOverflow answer (https://stackoverflow.com/a/58021389/11268971) to get my Docker build image process to use a cache directory with package wheels for pip install . However, when I switched from (suggested in the SO answer) # syntax = docker/dockerfile:experimental FROM python:3.7 RUN --mount=type=cache,target=/root/.cache/pip pip install -r requirements.txt to # syntax = docker/dockerfile:experimental FROM python:3.7 RUN --mount=type=cache,target=/home/my_username