mongosh

rtsp/mongosh Docker Image

基于Debian的Docker镜像,预装MongoDB Shell(mongosh)

3 次收藏下载次数: 0状态:社区镜像维护者:rtsp仓库类型:镜像最近更新:
下载命令
点击查看

RTSP MongoDB Shell Docker Image

Debian with https://docs.mongodb.com/mongodb-shell/ included.

mongosh Usage

For the mongosh command usage, please refer to the following documents.

  • https://docs.mongodb.com/mongodb-shell/connect/
  • https://docs.mongodb.com/mongodb-shell/run-commands/
    • https://docs.mongodb.com/mongodb-shell/crud/
    • https://docs.mongodb.com/mongodb-shell/run-agg-pipelines/
  • https://docs.mongodb.com/mongodb-shell/reference/options/

Usage

In order to use image from GitHub Container Registry instead of Docker Hub, you can replace rtsp/mongosh with ghcr.io/rtsp/docker-mongosh anywhere in the instruction below.

Pull Image

ShellSession
docker pull rtsp/mongosh

Interactive Mode

ShellSession
docker run --rm -it rtsp/mongosh mongosh -- mongodb://172.17.0.1:27017
ShellSession
docker run --rm -it rtsp/mongosh bash

Run a Specific Command

ShellSession
docker run --rm rtsp/mongosh mongosh -- mongodb://172.17.0.1:27017 --eval 'db.serverStatus()'

Run as Daemon

ShellSession
docker run -d --name mongosh rtsp/mongosh
ShellSession
docker exec mongosh mongosh -- mongodb://172.17.0.1:27017 --eval 'db.serverStatus()'

docker exec -it mongosh mongosh -- mongodb://172.17.0.1:27017

docker exec -it mongosh bash

Run as Kubernetes Pod

yaml
---
apiVersion: v1
kind: Pod
metadata:
  name: mongosh
spec:
  containers:
  - name: mongosh
    image: rtsp/mongosh:latest
ShellSession
kubectl exec mongosh -- mongosh mongodb://ENDPOINT:27017 --eval 'db.serverStatus()'

kubectl exec -it mongosh -- mongosh mongodb://ENDPOINT:27017

kubectl exec -it mongosh -- bash

Run as Kubernetes Deployment

yaml
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: mongosh
spec:
  replicas: 1
  selector:
    matchLabels:
      name: mongosh
  template:
    metadata:
      labels:
        name: mongosh
    spec:
      containers:
        - name: mongosh
          image: rtsp/mongosh:latest
          imagePullPolicy: Always
ShellSession
kubectl exec deployment/mongosh -- mongosh mongodb://ENDPOINT:27017 --eval 'db.serverStatus()'

kubectl exec -it deployment/mongosh -- mongosh mongodb://ENDPOINT:27017

kubectl exec -it deployment/mongosh -- bash

Links

Packages

  • Docker Hub: https://hub.docker.com/r/rtsp/mongosh/
  • GitHub: https://github.com/rtsp/docker-mongosh/pkgs/container/docker-mongosh

Source Code

  • https://github.com/rtsp/docker-mongosh

镜像拉取方式

您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。

轩辕镜像加速拉取命令点我查看更多 mongosh 镜像标签

docker pull docker.xuanyuan.run/rtsp/mongosh:<标签>

DockerHub 原生拉取命令

docker pull rtsp/mongosh:<标签>
专业版 · 高速稳定拉取镜像
50GB 仅 ¥8/年
高速镜像下载在线技术支持专业版保障服务可用付费会员免广告