Skip to content
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

ENTRYPOINT documentation #686

Open
make-github-pseudonymous-again opened this issue Apr 18, 2024 · 1 comment
Open

ENTRYPOINT documentation #686

make-github-pseudonymous-again opened this issue Apr 18, 2024 · 1 comment

Comments

@make-github-pseudonymous-again

Would it be possible to document what the embedded ENTRYPOINT does (globally, or for each version, whichever makes sense)? Took me several hours to figure out the ECONNREFUSED was caused by me overriding ENTRYPOINT with mongod ... omitting --bind-ip and --bind-ip-all in compose.yaml.

No idea why I used entrypoint instead of command, but there I was, banging my head against the wall. It was fun though, crawling through all these posts of people desperate to connect to their database, throwing in --bind-ip-all, --connection=direct, publishing ports, without success. Or another post about this person getting their entire database contents replaced by a bitcoin ransom message because they had exposed 27017 to the outside world. I guess that's why mongo binds to localhost only by default...

What was relevant in my case, is that the embedded entrypoint (for Mongo 5.0 at least) adds --bind-ip-all if it cannot find any explicit mention of --bind-ip or --bind-ip-all in the command arguments (because, after all, if you are running in a container and you do not expose that port, what's the point). So, overriding the entrypoint means you have to explicitly add --bind-ip or --bind-ip-all to the new entrypoint.

My question is, I guess, are there other things this entrypoint does that we should be aware of? What do we miss if we set entrypoint: mongod --bind-ip-all --db-path ... --replSet rs01?

@LaurentGoderre
Copy link
Member

The entrypoint takes care of the initialization of the environment. It's not recommended to overwrite it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants