Skip to content

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

@abhi5658

Description

@abhi5658

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:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions