6 / 6
Aug 2024

Hi, I’m trying to use mongo with atlas search on local development and local docker image.

When I add volume to docker-compose:

mongo: image: mongodb/mongodb-atlas-local:latest environment: - MONGODB_INITDB_ROOT_USERNAME=${MONGO_DB_USERNAME} - MONGODB_INITDB_ROOT_PASSWORD=${MONGO_DB_PASSWORD} ports: - 27018:27017 volumes: - ${DATA_DIRECTORY}/${MONGO_DB_ATLAS_DIRECTORY}/data:/data/db - ./mongo_init:/mongo_init

I get an error:

Error: error initializing: error writing key file: open /data/configdb/keyfile: permission denied

I tried different set of privileges (999:999, 993:994 etc). I have docker ignore with data folder. I don’t know what else I should test.

I would appreciate any advice.

15 days later
1 month later

@Do_Gier @Brian_Shen have a look here:

22 days later

For others experiencing the same problem, I found a viable workaround.

You can also add a volume for /data/configdb and it will no longer have this error on subsequent starts.

services: mongodb: image: mongodb/mongodb-atlas-local:7.0.12 volumes: - db-data:/data/db - db-config:/data/configdb volumes: db-data: db-config: