-
Notifications
You must be signed in to change notification settings - Fork 623
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
Files in docker-entrypoint-initdb.d do not get executed on Windows images #291
Comments
Yeah, this is an unfortunate design limitation of Windows containers. On Linux, we have the |
Thanks for the detailed response! |
I'm not familiar with mongodb initialization approach under the hood, but it seems like on linux containers it is done in following style:
What about defining some windows shell script (e.g. ps) which will do this initialization for windows containers? Like this:
Does it make sense? |
The key bit on Linux is that we can end with Windows does not have equivalent functionality, so either |
@tianon thank you, I see your point. In this case - is it possible to make mongo in linux container to omit phase of cheking chmod permissions (400) for key file? Because if you are running linux mongo containers on Windows host OS - it is impossible to set chmod on mounted file. This two problems together (lack of init of win-containers + forced chmod check on lin-containers) make impossible enabling keyfile-auth for mongo on windows hosts. |
@npiskunov, permissions check on keyfiles is not in our docker entrypoint script; that is just what MongoDB itself does. You could use Docker secrets, rather than |
@yosifkit, thank you for reply. Sure, checking file mode is a mongod process limitation, not docker image. I've tried to use docker-compose secret to put keyfile in container, but mongo process requires this file to be in mode 400 and owned by 999:999. gid,uid and mode options of compose-file are available only with docker stack, but not with docker compose. (Here is the issue docker/compose#4994) |
Is there any solution for Windows containers to run a db init script directly in docker-compose file ? |
@dbouffioux I am wondering the exact same thing and have been struggling with it all day. Did you find any answer? |
According to the documentation,
This does not seem to be the case for Windows images. Are there plans to add this functionality to the Windows images?
The text was updated successfully, but these errors were encountered: