- 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
推薦閱讀
- 演進式架構(原書第2版)
- Oracle WebLogic Server 12c:First Look
- Fundamentals of Linux
- 企業級Java EE架構設計精深實踐
- 劍指JVM:虛擬機實踐與性能調優
- 信息安全技術
- 網店設計看這本就夠了
- TypeScript項目開發實戰
- Mastering Linux Network Administration
- 從零開始學Android開發
- 交互式程序設計(第2版)
- 嵌入式Linux C語言程序設計基礎教程
- IPython Interactive Computing and Visualization Cookbook
- Enterprise Application Architecture with .NET Core
- 數據庫技術及應用教程上機指導與習題(第2版)