0

I know this is a duplicate, but I tried every solution and there is no solution that works.

Informations:

  • Docker-Compose 3.9
  • MacOS Big Sur 11.5

My Docker-compose.yml

version: '3.9'
services:
  database:
    user: 'root'
    image: 'mongo'
    container_name: 'database'
    environment:
      - MONGO_INITDB_DATABASE=TODODATABASE
    volumes:
      - ./mongo-volume:/data/db:rw
    ports:
      - '27017-27019:27017-27019'

So after restarting this container, sometimes there is this error:

chown: changing ownership of '/data/db/diagnostic.data/._metrics.2021-08-25T20-06-30Z-00000': Operation not permitted
chown: changing ownership of '/data/db/._WiredTiger': Operation not permitted
chown: changing ownership of '/data/db/._WiredTiger.lock': Operation not permitted
chown: changing ownership of '/data/db/._WiredTiger.turtle': Operation not permitted
chown: changing ownership of '/data/db/._WiredTiger.wt': Operation not permitted
chown: changing ownership of '/data/db/._WiredTigerHS.wt': Operation not permitted
chown: changing ownership of '/data/db/.__mdb_catalog.wt': Operation not permitted
chown: changing ownership of '/data/db/._collection-0--859388938869596022.wt': Operation not permitted
chown: changing ownership of '/data/db/._collection-0-6066413641713669140.wt': Operation not permitted
chown: changing ownership of '/data/db/._collection-2--859388938869596022.wt': Operation not permitted
chown: changing ownership of '/data/db/._collection-4--859388938869596022.wt': Operation not permitted
chown: changing ownership of '/data/db/._diagnostic.data': Operation not permitted
chown: changing ownership of '/data/db/._index-1--859388938869596022.wt': Operation not permitted
chown: changing ownership of '/data/db/._index-1-6066413641713669140.wt': Operation not permitted
chown: changing ownership of '/data/db/._index-3--859388938869596022.wt': Operation not permitted
chown: changing ownership of '/data/db/._index-5--859388938869596022.wt': Operation not permitted
chown: changing ownership of '/data/db/._index-6--859388938869596022.wt': Operation not permitted
chown: changing ownership of '/data/db/._journal': Operation not permitted
chown: changing ownership of '/data/db/._mongod.lock': Operation not permitted
chown: changing ownership of '/data/db/._sizeStorer.wt': Operation not permitted
chown: changing ownership of '/data/db/._storage.bson': Operation not permitted
chown: changing ownership of '/data/db/diagnostic.data/._metrics.2021-08-25T20-06-30Z-00000': Operation not permitted
chown: changing ownership of '/data/db/diagnostic.data/._metrics.2021-08-26T09-41-04Z-00000': Operation not permitted
chown: changing ownership of '/data/db/journal/._WiredTigerLog.0000000002': Operation not permitted
chown: changing ownership of '/data/db/journal/._WiredTigerPreplog.0000000001': Operation not permitted
chown: changing ownership of '/data/db/journal/._WiredTigerPreplog.0000000002': Operation not permitted

So how can I fix this?

DoctorFuchs
  • 36
  • 1
  • 8
  • Does this answer your question? [Docker - chown: changing ownership of '/data/db': Operation not permitted](https://stackoverflow.com/questions/67498836/docker-chown-changing-ownership-of-data-db-operation-not-permitted) – fmdaboville Aug 26 '21 at 15:49

0 Answers0