- MongoDB Administrator’s Guide
- Cyrus Dasadia
- 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
推薦閱讀
- 深度實踐OpenStack:基于Python的OpenStack組件開發
- 玩轉Scratch少兒趣味編程
- 深度學習經典案例解析:基于MATLAB
- NLTK基礎教程:用NLTK和Python庫構建機器學習應用
- Securing WebLogic Server 12c
- 單片機C語言程序設計實訓100例
- Extreme C
- Microsoft 365 Certified Fundamentals MS-900 Exam Guide
- App Inventor少兒趣味編程動手做
- 大學計算機應用基礎(Windows 7+Office 2010)(IC3)
- JavaEE架構與程序設計
- Swift High Performance
- Building a Media Center with Raspberry Pi
- JBoss AS 7 Development
- Visual FoxPro程序設計