-
Notifications
You must be signed in to change notification settings - Fork 633
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
Add an example to documentation for "Initializing a fresh instance" #663
Comments
@melvingaye could you open a PR here: https://github.com/docker-library/docs/blob/master/mongo/content.md |
@melvingaye so its mandatory to do the db.getSibilings()? I don't understand it, if i have to specify the custom db in the script, what's the point to use the MONGO_INITDB_DATABASE environment variable in the first place? Thanks in advance! |
I'm losing my mind here. Is there something I need to do to ensure that the root user is created on first startup? Yes, I've read the docs. I docker 'down', delete all volumes, all containers, even images, prune system -af – I have even reinstalled Docker, and I still cannot get mongo to create the root user in the auth database on startup. run-servers.yml:
${PROJECT_ROOT}/dev.mongodb.conf:
Servers start. Mongo doesn't print anything about a root user being created. Does anyone know what I'm doing wrong here?
Nope, authentication failed. I would really appreciate some help on this. I just lost my 3rd day trying to figure this out. Thank you. PS: I'm on macOS Sequoia 15.2, and the issue appears to yield the same result with both |
@drone1 from your example, the config file doesn't seem to be added to the container. |
Even without the config file it's working for me though. Here is it working by creating an ephemeral container to connect to the mongo instance
|
I just figured it out actually:
this is wrong. When you use So this was the root of all my issues here. No pun intended. Also: kill me. Also: thanks a lot for getting back here so quickly. Oh hmm, you don't specify a db name for --authenticationDatabase either? Now I'm even more confused. |
Problem
Setting up a user and db (other than the admin user and test db) is a little opaque.
This link How to create a DB for MongoDB container on start up? with over 268K views shows how much of an issue the lack of documentation is. There are many other variations of the search term above, so I'd imagine the numbers would be a lot higher if they were all tallied.
Proposal
Please include something like the below in that section of the documentation
docker-compose.yaml
mongo-init.js
The text was updated successfully, but these errors were encountered: