Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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_INITDB_ROOT_USERNAME not working with nanoserver image #598

Closed
hatzhang opened this issue Jan 4, 2023 · 1 comment
Closed

MONGO_INITDB_ROOT_USERNAME not working with nanoserver image #598

hatzhang opened this issue Jan 4, 2023 · 1 comment

Comments

@hatzhang
Copy link

hatzhang commented Jan 4, 2023

The sample stack.yml works with linux.

version: '3.1'
services:
  mongo:
    image: mongo
    restart: always
    environment:
      MONGO_INITDB_ROOT_USERNAME: root
      MONGO_INITDB_ROOT_PASSWORD: example

But if i change image to nanoserver, and run it under windows, authentication error will occur.

version: '3.1'
services:
  mongo:
    image: mongo:nanoserver
    restart: always
    environment:
      MONGO_INITDB_ROOT_USERNAME: root
      MONGO_INITDB_ROOT_PASSWORD: example
    ports:
      - 27017:27017

On client side:

MongoDB.Driver.MongoAuthenticationException
Unable to authenticate using sasl protocol mechanism SCRAM-SHA-1.

On server side:

"error":"UserNotFound: Could not find user "root" for db "test""}}

@yosifkit
Copy link
Member

yosifkit commented Jan 4, 2023

#291 (comment)

@docker-library docker-library locked and limited conversation to collaborators Jan 4, 2023
@tianon tianon converted this issue into discussion #599 Jan 4, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants