Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows docker-compose mongo service stops due to "Operation is not permitted" error #17

Open
abhi5658 opened this issue Apr 17, 2021 · 0 comments

Comments

@abhi5658
Copy link

Docker: Docker for Windows
OS: Windows 10

As per the docker-compose.yml => mongo service uses the volume ./data mount to store data of mongo service.

For the very first time when you run/build your app, the mongo service + the api service runs fine.

For subsequent restart of the services, the mongo service exits as it faces a issue with windows file system and shows the error as "Operation is not permitted".

Description of the issue that I found: https://stackoverflow.com/a/39013930/8133717

Therefore one can change the ./data mount to docker's internal volume to mitigate the issue caused by data storage in windows file system.

Changes:

version: '3'
services:
  api:
    image: makinhs/rest-api-tutorial
    #...

  mongo:
    image: mongo
    volumes:
      #mounting to docker's own volume system
      - rest-api-tutorial-data:/data/db 
    networks:
      - backend
    ports:
      - "27017:27017"

# adding the volumes needed at the end
volumes: 
  rest-api-tutorial-data:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant