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

Mongo 4.0 windows containers - root user environment variable #335

Closed
prokhorovn opened this issue Feb 12, 2019 · 1 comment
Closed

Mongo 4.0 windows containers - root user environment variable #335

prokhorovn opened this issue Feb 12, 2019 · 1 comment

Comments

@prokhorovn
Copy link

prokhorovn commented Feb 12, 2019

Hello, I'm facing a problem with setting up authentication for mongo. It seems like windows-based docker images ignore MONGO_INITDB_ROOT_USERNAME, MONGO_INITDB_ROOT_PASSWORD environment variables and don't create admin database. When I add keyfile to my containers startup, it enforces authentication (expected behavior), as the result I'm able to connect to container with mongo shell, but can't authenticate using credentials passed via environment variables.

After inspecting images sources I've found out that this initialization seems to happen in docker-entrypoint.sh, which are not entrypoint for windows-based images.
For linux image:

ENTRYPOINT ["docker-entrypoint.sh"]

EXPOSE 27017
CMD ["mongod"]

For windows image:
EXPOSE 27017 CMD ["mongod", "--bind_ip_all"]

Do windows-based images support MONGO_INITDB_ROOT_USERNAME and js initscripts in /docker-entrypoint-initdb.d/ ?

P.S. everything works fine when I just switch to linux containers (with the same compose file)

@yosifkit
Copy link
Member

#291 (comment)

@tianon tianon closed this as completed Feb 12, 2019
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

3 participants