In a Dockerfile, I am mounting a cache:
RUN --mount=type=cache,target=/opt/conda/pkgs \
...
I would like this mount to be valid for the duration of either
Is there a way to do this?
I'm not able to find any reference in the documentation.
Try making use of the multi stage Dockerfile
For example :-
FROM BASE_IMAGE:tag AS base
RUN --mount=type=cache,target=/opt/conda/pkgs \
...
FROM BASE_IMAGE:tag AS app
RUN mkdir /some/place
COPY --from=base "/opt/conda/pkgs"