Docker for Windows Error Can t call chown inside Docker container

0 votes

I am trying to use the Mongo dockerfile to boot up a database, I use the -v command to map a local directory to the data inside the container.

This is how I’m doing it:

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

But unfortunately I get the following error:

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

Can someone help me out with this?

Oct 30, 2018 in Docker by Sophie may
• 10,620 points
1,491 views

1 answer to this question.

0 votes

I’ve come across a similar issue, try the below command, it should work:

docker run --name mongo -p 27017:27017 -v /var/lib/boot2docker/my-mongodb-data/:/data/d
answered Oct 30, 2018 by Tyrion anex
• 8,700 points

Related Questions In Docker

0 votes
1 answer

Error: Docker for Windows not working

The following worked for me: Download VirtualBox 5.03  Reboot ...READ MORE

answered Aug 14, 2018 in Docker by Sophie may
• 10,620 points
1,348 views
0 votes
1 answer

Error: “Docker for Windows: No hypervisor is present”

I faced the same error and this ...READ MORE

answered Aug 14, 2018 in Docker by Sophie may
• 10,620 points
1,233 views
0 votes
1 answer
0 votes
1 answer

Error: Docker for windows failing to start

I got the same error, just follow ...READ MORE

answered Sep 4, 2018 in Docker by Tyrion anex
• 8,700 points
771 views
+2 votes
1 answer
+2 votes
1 answer

Deploy Docker Containers from Docker Cloud

To solve this problem, I followed advice ...READ MORE

answered Sep 3, 2018 in AWS by Priyaj
• 58,020 points
2,718 views
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP