Cannot call chown inside Docker container (Docker for Windows)

I'm trying to use the official Mongo dockerfile to load the database, I use the -v command to map the local to / data directory inside the container.

As part of the docker file, it tries to use this directory for the mongodb user:

RUN mkdir -p /data/db /data/configdb \
    && chown -R mongodb:mongodb /data/db /data/configdb
VOLUME /data/db /data/configdb

However, this is not performed with the following command:

chown: changing ownership of '/data/db': Permission denied

What am I doing wrong here? I can not find any documentation about this - of course, the container must have full access rights to the mapped directory, since it was explicitly passed in the docker launch command:

docker run -d --name mongocontainer -v R:\mongodata:/data/db -p 3000:27017 mongo:latest
+4
source share
1 answer

, mongo issues 68 74

- /Users ( ~). :

docker run --name mongo -p 27017:27017 -v /var/lib/boot2docker/my-mongodb-data/:/data/db -d mongo --storageEngine wiredTiger

PR 470 :

: MongoDB , vboxsf ( vbox).

VirtualBox MongoDB (. docs.mongodb.org jira.mongodb.org ).

, Docker Toolbox , MongoDB , .

+1

Source: https://habr.com/ru/post/1662091/


All Articles