$ docker search mongo
# mongodb 5.x
$ docker pull mongo:latest
$ mkdir mongodb
$ cd mongodb
$ docker run -p 27017:27017 -v $PWD/data/db:/data/db --name mongodb -d mongo --auth
$ docker exec -it mongodb mongo admin
$ db.createUser({ user: 'root', pwd: '123456', roles: [ { role: "userAdminAnyDatabase", db: "admin" } ] });
$ exit