Score:0

Accessing a Docker volume created with docker run -v from the host when running Docker in rootless context / no root mode

us flag

I've created a container and used the volume switch to share a directory between the host and my container, e.g. -v /home/docker/mydirectory:/etc/myapp/directory I can see the directory as root or a sudo user, but my docker daemon is running under the docker user (no sudo privileges) for security reasons, however, that user has no rights to the files in that directory on the host. The owner of the directory is a number (165605):

drwx------ 19 165605 docker mydirectory

As you can see, only the 165605 "user" has access by default.

How do I assign or ensure the docker user has access when creating the container?

R2Bleep2 avatar
us flag
Just to clarify further, the subdirectory above exists in the /home/docker directory and was created by user docker of group docker before the docker run command was executed (both group and user had full access). After docker run is what you see. Docker user and group no longer have rights to the directory. This was the result of the docker run execution. Is the only way to resolve it really to manually assign the docker group access again using a sudo account? Is there another way to use the volumes switch for different results?
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.