I'm using docker to build huge rust project, so i wanted to use sccache to cache building artifacts on host.
I found experimental future for run, but can't understand from documentation how it's working.
# syntax=docker/dockerfile:experimental
# part of dockerfile is ommited
ARG CACHE_FOLDER_PATH=/home/user/cache/.sccache
RUN mkdir /cache
ENV SCCACHE_DIR='/cache'
RUN --mount=type=cache,target=/cache,source=$CACHE_FOLDER_PATH cargo build --release --all #here i expected, that $CACHE_FOLDER_PATH will be mounted in $SCCACHE_DIR, but it's now working
If i'm wrong and caching artifacts via run is impossible, how should it be done? docs link