title: Error starting MongoDB with volumen via docker-compose
body: <p>I want to start a mongodb with a data volumen via docker-compose.</p>
  
  <p>This is my docker-compose file</p>
  
  <pre><code>version: '3'
  services: 
      mongodb_container:
          image: 'mongo:4.2'
          container_name: mongodb
          environment: 
              MONGO_INITDB_ROOT_USERNAME: root
              MONGO_INITDB_ROOT_PASSWORD: secret
          volumes:
              - ./data:/data/db
          ports:
              - '27017-27019:27017-27019' 
  
  volumes:
      data:
  </code></pre>
  
  <p>But when I run docker-compose up I get the following error:</p>
  
  <pre><code>mongodb              | 2020-05-07T07:13:12.678+0000 E  STORAGE  [initandlisten] WiredTiger error (1) [1588835592:678833][27:0x7f5536ec2b00], connection: __posix_open_file, 667: /data/db/WiredTiger.wt: handle-open: open: Operation not permitted Raw: [1588835592:678833][27:0x7f5536ec2b00], connection: __posix_open_file, 667: /data/db/WiredTiger.wt: handle-open: open: Operation not permitted
  mongodb              | 2020-05-07T07:13:12.698+0000 E  STORAGE  [initandlisten] WiredTiger error (17) [1588835592:698982][27:0x7f5536ec2b00], connection: __posix_open_file, 667: /data/db/WiredTiger.wt: handle-open: open: File exists Raw: [1588835592:698982][27:0x7f5536ec2b00], connection: __posix_open_file, 667: /data/db/WiredTiger.wt: handle-open: open: File exists
  mongodb              | 2020-05-07T07:13:12.703+0000 I  STORAGE  [initandlisten] WiredTiger message unexpected file WiredTiger.wt found, renamed to WiredTiger.wt.1
  mongodb              | 2020-05-07T07:13:12.706+0000 E  STORAGE  [initandlisten] WiredTiger error (1) [1588835592:706964][27:0x7f5536ec2b00], connection: __posix_open_file, 667: /data/db/WiredTiger.wt: handle-open: open: Operation not permitted Raw: [1588835592:706964][27:0x7f5536ec2b00], connection: __posix_open_file, 667: /data/db/WiredTiger.wt: handle-open: open: Operation not permitted
  mongodb              | 2020-05-07T07:13:12.722+0000 E  STORAGE  [initandlisten] WiredTiger error (17) [1588835592:722667][27:0x7f5536ec2b00], connection: __posix_open_file, 667: /data/db/WiredTiger.wt: handle-open: open: File exists Raw: [1588835592:722667][27:0x7f5536ec2b00], connection: __posix_open_file, 667: /data/db/WiredTiger.wt: handle-open: open: File exists
  mongodb              | 2020-05-07T07:13:12.727+0000 I  STORAGE  [initandlisten] WiredTiger message unexpected file WiredTiger.wt found, renamed to WiredTiger.wt.2
  mongodb              | 2020-05-07T07:13:12.730+0000 E  STORAGE  [initandlisten] WiredTiger error (1) [1588835592:730629][27:0x7f5536ec2b00], connection: __posix_open_file, 667: /data/db/WiredTiger.wt: handle-open: open: Operation not permitted Raw: [1588835592:730629][27:0x7f5536ec2b00], connection: __posix_open_file, 667: /data/db/WiredTiger.wt: handle-open: open: Operation not permitted
  mongodb              | 2020-05-07T07:13:12.746+0000 E  STORAGE  [initandlisten] WiredTiger error (17) [1588835592:746573][27:0x7f5536ec2b00], connection: __posix_open_file, 667: /data/db/WiredTiger.wt: handle-open: open: File exists Raw: [1588835592:746573][27:0x7f5536ec2b00], connection: __posix_open_file, 667: /data/db/WiredTiger.wt: handle-open: open: File exists
  mongodb              | 2020-05-07T07:13:12.750+0000 I  STORAGE  [initandlisten] WiredTiger message unexpected file WiredTiger.wt found, renamed to WiredTiger.wt.3
  mongodb              | 2020-05-07T07:13:12.753+0000 E  STORAGE  [initandlisten] WiredTiger error (1) [1588835592:753788][27:0x7f5536ec2b00], connection: __posix_open_file, 667: /data/db/WiredTiger.wt: handle-open: open: Operation not permitted Raw: [1588835592:753788][27:0x7f5536ec2b00], connection: __posix_open_file, 667: /data/db/WiredTiger.wt: handle-open: open: Operation not permitted
  mongodb              | 2020-05-07T07:13:12.769+0000 E  STORAGE  [initandlisten] WiredTiger error (17) [1588835592:769965][27:0x7f5536ec2b00], connection: __posix_open_file, 667: /data/db/WiredTiger.wt: handle-open: open: File exists Raw: [1588835592:769965][27:0x7f5536ec2b00], connection: __posix_open_file, 667: /data/db/WiredTiger.wt: handle-open: open: File exists
  mongodb              | 2020-05-07T07:13:12.774+0000 I  STORAGE  [initandlisten] WiredTiger message unexpected file WiredTiger.wt found, renamed to WiredTiger.wt.4
  mongodb              | 2020-05-07T07:13:12.778+0000 E  STORAGE  [initandlisten] WiredTiger error (1) [1588835592:778352][27:0x7f5536ec2b00], connection: __posix_open_file, 667: /data/db/WiredTiger.wt: handle-open: open: Operation not permitted Raw: [1588835592:778352][27:0x7f5536ec2b00], connection: __posix_open_file, 667: /data/db/WiredTiger.wt: handle-open: open: Operation not permitted
  mongodb              | 2020-05-07T07:13:12.780+0000 W  STORAGE  [initandlisten] Failed to start up WiredTiger under any compatibility version.
  mongodb              | 2020-05-07T07:13:12.780+0000 F  STORAGE  [initandlisten] Reason: 1: Operation not permitted
  mongodb              | 2020-05-07T07:13:12.780+0000 F  -        [initandlisten] Fatal Assertion 28595 at src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp 915
  mongodb              | 2020-05-07T07:13:12.780+0000 F  -        [initandlisten]
  mongodb              |
  mongodb              | ***aborting after fassert() failure
  mongodb              |
  mongodb              |
  mongodb              | ERROR: child process failed, exited with error number 14
  mongodb              | To see additional information in this output, start without the "--fork" option.
  </code></pre>
  
  <p>Any Ideas?</p>