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

Using this sidecar disables running docker-entrypoint scripts #121

Open
alitoufighi opened this issue Sep 25, 2020 · 2 comments
Open

Using this sidecar disables running docker-entrypoint scripts #121

alitoufighi opened this issue Sep 25, 2020 · 2 comments

Comments

@alitoufighi
Copy link

alitoufighi commented Sep 25, 2020

I am stuck in a situation where I need to populate my Replica Set with some data, while using this sidecar to initiate the Replica Set and scale it automatically.

What I have is a mongo container with a script mounted in /docker-entrypoint-initdb.d/ and running this sidecar aside it. Since this sidecar runs asynchronously with the mongo, we have no guarantee when mongo's docker entrypoint script will check for its data directory being empty, hence by running mongo commands, this sidecar will cause the data directory to be not empty.

@alitoufighi
Copy link
Author

To solve this, I think a simple sleep would be a workaround.
A better fix would be watching data directory until it becomes non-empty, and then running workloop.

@alitoufighi
Copy link
Author

I had forgotten that you can't write to a mongod started with --replSet option when a Replica Set is not initiated.
So my above solutions are not valid for this case.
I think the problem was with my approach to initialize my replica set database in this way. If anyone can confirm this, I think we can close the issue.

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

1 participant