docker pull mongo:latest
docker run -itd --name mongo -p 27017:27017 mongo --auth
docker exec -it mongo mongo admin
db.createUser({ user:'admin',pwd:'123456',roles:[ { role:'userAdminAnyDatabase', db: 'admin'},"readWriteAnyDatabase"]});
db.auth('admin', '123456');
exit
以wekan容器的启动示例:
docker run -d --restart=always --name wekan --link "mongo:db" -e "MONGO_URL=mongodb://admin:123456@db" -e "ROOT_URL=http://web.url.com:8282" -p 8080:80 wekanteam/wekan