docker 进入容器的mongodb



docker search mongo

docker pull mongo

docke run -p 27017:27017 -v $PWD/db:/data/db -d  --name mymongo mongo

docker ps 

docker exec -it con_Id sh

mongo

db.use test

db.stu.insert({name:'test001'})

exit

exit

即可退出shell

docker stop mymongo

docker ps -a

docker start mymongo

 

posted @ 2018-07-15 16:31  江山一族  阅读(7791)  评论(0编辑  收藏  举报