0

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?

shelper
  • 10,053
  • 8
  • 41
  • 67
  • 1
    check the ownership of the "code" folder in host system. – gp. Jun 23 '20 at 02:47
  • First, read the code: https://github.com/conan-io/conan-docker-tools/blob/master/gcc_10/Dockerfile. All images use 1001 as group id for conan folder. It's a workaround to allow volumes and write permission at same time. – uilianries Jun 23 '20 at 12:37
  • Is there a way to mount the volume to be writable when in container? – shelper Jun 23 '20 at 14:47

0 Answers0