I am on a remote server where I am a user in the group docker. I created two volumes:
docker create volume conan
&& docker create volume code`
I am using the docker image called conanio/gcc10, so I run:
docker run --rm \
-v code:/home/conan/.code \
-v conan:/home/conan/.conan \
-it conanio/gcc10 /bin/bash
Then in the container environment I have:
drwxr-xr-x 2 conan 1001 4096 Jun 23 01:58 .conan/
drwxr-xr-x 2 root root 4096 Jun 23 01:58 .code/
why they have different owner? .code's owner is root and .conan's owner is conan? I tried different names and all are the same, only .conan's owner is conan. I also tried other images as well. Is that because the conan volume matches the user name in the container???
is there a way to use conan for other mounted volume as well?