Docker Community Forums

Share and learn in the Docker community.

Openssl rand -base64 741 permission denied and could not create folder by docker exec mongoNode1 bash -c

$ docker run --name mongoNode1
-v mongo_storage:/data
-d mongo

Next we need to create the key file.

The contents of the keyfile serves as the shared password for the members of the replica set. The content of the keyfile must be the same for all members of the replica set.

$ openssl rand -base64 741 > mongo-keyfile // permission denied

$ chmod 600 mongo-keyfile

Next let’s create the folders where is going to hold the data, keyfile and configurations inside the mongo_storage volume:

$ docker exec mongoNode1 bash -c ‘mkdir /data/keyfile /data/admin’

I could not create folder data/…
container id … is not running


I’m using docker toolbox and i’m new create docker with mongodb …( the bold text is issue) How to fix it. Thanks