mongoDb
- 下载并启动
docker run --name mongo -p 27017:27017 -d mongo:latest --auth
- 进入容器
docker exec -it container_id mongo admin
- 创建admin
db.createUser({ user: 'admin', pwd: 'admin', roles: [ { role: "userAdminAnyDatabase", db: "admin" } ] });
#验证一下对不对
db.auth("admin","admin");
#退出
exit
- 创建业务库
use zzf;
db.createUser({ user: "zzf", pwd: "zzf", roles: [ { role: "dbAdmin", db:"zzf" } ] });
#or
db.createUser({ user: "zzf", pwd: "zzf", roles: [ { role: "readWrite", db:"zzf" } ] });
db.auth("zzf","zzf");
db.items.insert({"name":2})
rabbitmq
docker run --name rabbitmq -d -p 15672:15672 -p 5672:5672 rabbitmq:management
进入 ip:15672 账号密码都是guest