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""}}