書名: MongoDB Administrator’s Guide作者名: Cyrus Dasadia本章字數(shù): 94字更新時間: 2021-07-02 15:47:46
How to do it...
- Download the latest MongoDB Docker image:
docker pull mongo:3.4.4
- Check that the image exists:
docker images
- Start a container:
docker run -d -v /data/db:/data/db --name mymongo mongo:3.4.4
- Check if the container is running successfully:
docker ps
- Let's connect to our mongo server using the mongo client from the container:
docker exec -it mymongo mongo
- Stop the mongo instance and with host mode networking:
docker run -d -v /data/db:/data/db --name mymongo --net=host mongo:3.4.4 --bind_ip 127.0.0.1 --port 27000
- Connect to the new instance using mongo shell:
docker exec -it mymongo mongo localhost:27000
推薦閱讀
- Google Flutter Mobile Development Quick Start Guide
- Mastering Zabbix(Second Edition)
- Vue.js 3.x從入門到精通(視頻教學版)
- Java程序設計與計算思維
- oreilly精品圖書:軟件開發(fā)者路線圖叢書(共8冊)
- 嚴密系統(tǒng)設計:方法、趨勢與挑戰(zhàn)
- C++ 從入門到項目實踐(超值版)
- Linux Device Drivers Development
- Mastering Business Intelligence with MicroStrategy
- Learning Node.js for .NET Developers
- MyBatis 3源碼深度解析
- 從零學Java設計模式
- C++服務器開發(fā)精髓
- 計算機應用基礎(Windows 7+Office 2010)
- Office VBA開發(fā)經(jīng)典:中級進階卷