[root@localhost ~]# docker exec -it mytest /bin/bash
[root@1c178edd6a92 /]# cd /home/Java/mongodb
[root@1c178edd6a92 mongodb]# bin/mongo –port 17016
> use cloudcc
switched to db cloudcc
> db.test.insert({“username”:”hacker”, “age”:26})
WriteResult({ “nInserted” : 1 })
> exit
bye
[root@1c178edd6a92 mongodb]# clear
[root@1c178edd6a92 mongodb]# bin/mongodump -h 172.17.0.5:17016 -d cloudcc -o /home/Java
2017-07-19T09:32:06.571+0000 writing cloudcc.test to
2017-07-19T09:32:06.573+0000 done dumping cloudcc.test (1 document)
[root@1c178edd6a92 mongodb]# ls /home/Java/
cloudcc mongodb mongodb-linux-x86_64-rhel70-3.4.5.tgz
[root@1c178edd6a92 mongodb]# ls /home/Java/cloudcc/
test.bson test.metadata.json
[root@1c178edd6a92 mongodb]#
[root@1c178edd6a92 mongodb]# bin/mongo –port 17016
> use cloudcc
switched to db cloudcc
> db.dropDatabase()
{ “dropped” : “cloudcc”, “ok” : 1 }
> exit
bye
[root@1c178edd6a92 mongodb]# bin/mongorestore -h 172.17.0.5:17016 -d cloudcc /home/Java/cloudcc/