BuildKit Cache Mounts
What does RUN --mount=type=cache,target=/root/.cache/pip pip install -r requirements.txt achieve?
RUN --mount=type=cache,target=/root/.cache/pip pip install -r requirements.txt
Choose one answer
It shares the cache with every container started from the image.
pip's cache persists between builds on that builder, but isn't part of the image.
It makes the layer cached forever, even when requirements.txt changes.
requirements.txt
It stores pip's downloads in the image, so later containers can install packages offline.