docker_practice/appendix/repo/mongodb.md

35 lines
788 B
Go
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

# [MongoDB](https://hub.docker.com/_/mongo/)
##
[MongoDB](https://en.wikipedia.org/wiki/MongoDB) 是开源的 NoSQL 数据库实现。
`https://hub.docker.com/_/mongo/` MongoDB 2.x ~ 4.x
## 使
`27017`
```bash
$ docker run --name mongo -d mongo
```
使
```bash
$ docker run --name some-app --link some-mongo:mongo -d application-that-uses-mongo
```
`mongo`
```bash
$ docker run -it --rm \
--link some-mongo:mongo \
mongo \
sh -c 'exec mongo "$MONGO_PORT_27017_TCP_ADDR:$MONGO_PORT_27017_TCP_PORT/test"'
```
## Dockerfile
https://github.com/docker-library/docs/tree/master/mongo 查看。