1. 安装
1.1 安装 mongodb
1 | mkdir ~/data |
1.2 将数据迁移到新容器
Let’s start a new MongoDB container, this time running on port 37017 instead of the default 27017:
1 | # Copy the data from the previous container |
2. 使用
1 | db.createCollection('cities') |
3. 参考资料
https://www.thachmai.info/2015/04/30/running-mongodb-container/
docker-compose 使用mongodb 参考 docker-compose的一次实践