In order to mitigate the following warning,
WARNING: The directory '/home/jovyan/.cache/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
I would usually run pip as
sudo -H pip install -r requirements.txt
Now I am executing pip within a Dockerfile:
FROM python3.7-slim
USER root
COPY requirements.txt /app/requirements.txt
RUN pip install -U setuptools pip \
&& pip install -r /app/requirements.txt
How would I activate the -H
flag?
Is there another way to activate the cache?