我的搬運工,撰寫:在未經許可的錯誤與蒙戈運行時,搬運工人
version: "2"
services:
bimbucket-api:
build: .
ports:
- "3007:3007"
links:
- mongo
volumes:
- .:/opt/app
mongo:
image: mongo
volumes:
- /data/db:/data/db
ports:
- "27017:27017"
我得到permissionerror:
mongo_1 | chown: changing ownership of '/data/db/diagnostic.data/metrics.2017-06-27T13-32-30Z-00000': Operation not permitted
mongo_1 | chown: changing ownership of '/data/db/journal/WiredTigerLog.0000000054': Operation not permitted
mongo_1 | chown: changing ownership of '/data/db/journal/WiredTigerPreplog.0000000001': Operation not permitted
mongo_1 | chown: changing ownership of '/data/db/journal/WiredTigerPreplog.0000000002': Operation not permitted
mongo_1 | chown: changing ownership of '/data/db/WiredTiger.turtle': Operation not permitted
mongo_1 | chown: changing ownership of '/data/db/WiredTigerLAS.wt': Operation not permitted
數據LS-LA:
ls -la data
total 0
drwxrwxrwx 3 root wheel 102 Dec 1 2016 .
drwxr-xr-x 35 root wheel 1258 Jun 25 04:29 ..
[email protected] 118 root wheel 4012 Jun 27 15:33 db
如果我手動更改在/data/db
的許可下,它將被改回。
這裏有什麼問題?如果我在本地運行mongo,沒有問題。
主機中/ data/db文件夾的權限是什麼?該應該由root用戶擁有,作爲root用戶在Docker容器內創建此文件夾。 –