Pass repository files down to a docker run command

If I want to run docker on a docker runner, and I want to have access to my repository files, how would I go about that?

The job in which I am running the extra docker container has already access to the files. But I cannot use those files, as providing the docker run command with a volume, it would be using paths from the docker host, not the job environment.

However, if there would be some way to use the same volumes-from as the job container, those files would be available to the new docker container through that shared volume. Is there any documentation on how to do that? A few months ago the following line would work, but it seems it was broken recently:
docker run --rm --volumes-from "${HOSTNAME}-build" --workdir "${CI_PROJECT_DIR}" image command

Using artifacts is only an option if I would create another step to create an artifact with all the files from the repository, and if I would know how to provide an artifact to a new docker run command.

Is there any way we might be able to share the repository files as they are present in the current job to a new docker run command?