一个基于bitnami/minideb的轻量MongoDB Shell容器镜像,用于交互式操作MongoDB数据库,支持传递连接URI及CLI选项。
MongoDB Shell Docker Image
A compact https://docs.mongodb.com/mongodb-shell Docker image based on https://hub.docker.com/r/bitnami/minideb base image.
[!IMPORTANT] For interactive usage only. No bells and whistles included.
Usage
This image is available as https://hub.docker.com/r/aeron/mongosh and https://github.com/Aeron/mongosh-docker/pkgs/container/mongosh. You can use them both interchangeably.
shdocker pull docker.io/aeron/mongosh # …or… docker pull ghcr.io/aeron/mongosh
Interactive Mode (Docker)
Run a container and pass a Mongo URI string, like the following:
shdocker run -it --rm aeron/mongosh:latest -- $MONGO_URI # …or… docker run -it --rm aeron/mongosh:latest -- mongodb://127.0.0.1:27017
Any https://docs.mongodb.com/mongodb-shell/reference/options mongosh supports could be provided alike:
shdocker run -it --rm aeron/mongosh:latest -- $MONGO_URI \ --nodb \ --eval 'disableTelemetry()'
Interactive Mode (Kubernetes)
Run a container inside a Kube cluster in a similar manner:
shkubectl run mongosh --rm --tty -i --restart=Never \ --image aeron/mongosh:latest -- $MONGO_URI
CLI options and everything else is the same here.
Daemon Mode
Nope, not going to happen. It’s not the purpose of this image.
If you actually need it, feel free to use this image as a basis. Then you need to
install the coreutils package and change Dockerfile’s entrypoint directive to
["sleep" "infinity"].
Or use a different image that allows that. It’d be more painless, probably.
Acknowledgment
The https://docs.mongodb.com/mongodb-shell is an open-source project made by https://github.com/mongodb-js and its contributors, available under https://opensource.org/license/apache-2-0.
镜像拉取方式
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。
DockerHub 原生拉取命令
用户好评
来自真实用户的反馈,见证轩辕镜像的优质服务