Hello,
I have used the following Dockerfile and I have used the path /data/db2, but I receive the same error as when I use the the path /data/db as volume.
DOCKERFILE:
FROM mongo:latest
Modify child mongo to use /data/db2 as dbpath (because /data/db wont persist the build)
RUN mkdir -p /data/db2 \
&& echo "dbpath = /data/db2" > /etc/mongodb.conf \
&& chown -R mongodb:mongodb /data/db2
COPY . /data/db2
RUN mongod --fork --logpath /var/log/mongodb.log --dbpath /data/db2 \
&& mongod --dbpath /data/db2 --shutdown \
&& chown -R mongodb /data/db2
CMD ["mongod", "--config", "/etc/mongodb.conf"]
Below you can find the docker-compose.yml:
version: '3'
services:
wpmongo:
image: domezurlo/azure-mongo:latest
volumes:
- db:/data/db2
webprotege:
image: protegeproject/webprotege
restart: always
ports: - 8080:8080
depends_on: - wpmongo
volumes:
db:
driver: azure_file
driver_opts:
share_name: share_name
storage_account_name: storage_account_name
The error is the following:
{"t":{"$date":"2021-12-02T18:42:44.195+00:00"},"s":"E", "c":"STORAGE", "id":22435, "ctx":"initandlisten","msg":"WiredTiger error","attr":{"error":1,"message":"[1638470564:195329][465:0x7ff2d3485c80], connection: __posix_open_file, 808: /data/db2/WiredTiger.wt: handle-open: open: Operation not permitted"}}
{"t":{"$date":"2021-12-02T18:42:44.202+00:00"},"s":"W", "c":"STORAGE", "id":22347, "ctx":"initandlisten","msg":"Failed to start up WiredTiger under any compatibility version. This may be due to an unsupported upgrade or downgrade."}
{"t":{"$date":"2021-12-02T18:42:44.202+00:00"},"s":"F", "c":"STORAGE", "id":28595, "ctx":"initandlisten","msg":"Terminating.","attr":{"reason":"1: Operation not permitted"}}
{"t":{"$date":"2021-12-02T18:42:44.202+00:00"},"s":"F", "c":"-", "id":23091, "ctx":"initandlisten","msg":"Fatal assertion","attr":{"msgid":28595,"file":"src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp","line":687}}
{"t":{"$date":"2021-12-02T18:42:44.202+00:00"},"s":"F", "c":"-", "id":23092, "ctx":"initandlisten","msg":"\n\n***aborting after fassert() failure\n\n"}
Could you help me, please?