Docker mount=type=cache not reused in runner

How to make docker runner work with mount=type=cache feature?

I have Dockerfile with fragment

ARG COMPOSER_CACHE_DIR=/home/${USER}/.composer/cache

RUN composer config cache-dir ${COMPOSER_CACHE_DIR}
RUN --mount=type=cache,target=${COMPOSER_CACHE_DIR},uid=${USER_ID},gid=${USER_ID} \
    composer install --no-interaction --no-dev --no-progress --prefer-dist --no-scripts

and locally it runs great, composer cache is used when composer package changes, build runs much faster. On the docker runner it does not work. Cache is not reused on secondary runs with changed composer.

I am using dind service

  image: docker:${DOCKER_VERSION}
    - docker:${DOCKER_VERSION}-dind

solution was to mount docker socket and not use docker in docker