Sign inSign up

rtsp/mongosh

By rtsp

•Updated about 2 months ago

Debian Docker image with MongoDB Shell preinstalled

Image
3

500K+

rtsp/mongosh repository overview

⁠RTSP MongoDB Shell Docker Image

Debian with MongoDB Shell (mongosh)⁠ included.

⁠mongosh Usage

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

⁠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
docker pull rtsp/mongosh
⁠Interactive Mode
docker run --rm -it rtsp/mongosh mongosh -- mongodb://172.17.0.1:27017
docker run --rm -it rtsp/mongosh bash
⁠Run a Specific Command
docker run --rm rtsp/mongosh mongosh -- mongodb://172.17.0.1:27017 --eval 'db.serverStatus()'
⁠Run as Daemon
docker run -d --name mongosh rtsp/mongosh
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
---
apiVersion: v1
kind: Pod
metadata:
  name: mongosh
spec:
  containers:
  - name: mongosh
    image: rtsp/mongosh:latest
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
---
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
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
⁠Packages
⁠Source Code

Tag summary

Content type

Image

Digest

sha256:f1d171da1…

Size

229.1 MB

Last updated

about 2 months ago

docker pull rtsp/mongosh