-
Notifications
You must be signed in to change notification settings - Fork 617
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set up authentication fails. #49
Comments
I agree would great to have a variable i could set to enable auth. |
You are getting this error because it takes a bit of time to start up mongo service. It seems people are using something like the following to avoid it: FROM mongo:3.2.0
COPY setup.sh /setup.sh
RUN /setup.sh setup.sh: #!/bin/bash
mongod --dbpath /data/db &
RET=1
while [[ RET -ne 0 ]]; do
echo "=> Waiting for confirmation of MongoDB service startup"
sleep 5
mongo admin --eval "help" >/dev/null 2>&1
RET=$?
done
ADMINUSER=user
ADMINPASS=pass
echo "=> Creating an admin user in MongoDB"
mongo admin --eval "db.createUser({user: '$ADMINUSER', pwd: '$ADMINPASS', roles:[{role:'root',db:'admin'}]});"
mongod --dbpath /data/db --shutdown However, after successfully building this image, and starting a container using this image with command @tianon , your input would be very appreciated! |
I also think it would be great to have a variable I could set to enable auth. |
Closing old issue, fixed by #145. Feel free to comment if you feel this was closed in error. |
It would be nice to have env variables for authentication enabling, to set username/password, storage engine .. etc.
For guideline I have been using https://github.com/tutumcloud/mongodb/tree/master/2.6
Here is my dockerfile:
The build returns:
Expected result - to build the image and set up new user.
The text was updated successfully, but these errors were encountered: