A compact mongosh
Docker image based on bitnami/minideb
base image.
For interactive usage only. No bells and whistles included.
This image is available as docker.io/aeron/mongosh
and
ghcr.io/Aeron/mongosh
. You can use them both interchangeably.
docker pull docker.io/aeron/mongosh
# …or…
docker pull ghcr.io/aeron/mongosh
Run a container and pass a Mongo URI string, like the following:
docker run -it --rm aeron/mongosh:latest -- $MONGO_URI
# …or…
docker run -it --rm aeron/mongosh:latest -- mongodb://127.0.0.1:27017
Any CLI options mongosh
supports could be provided alike:
docker run -it --rm aeron/mongosh:latest -- $MONGO_URI \
--nodb \
--eval 'disableTelemetry()'
Run a container inside a Kube cluster in a similar manner:
kubectl run mongosh --rm --tty -i --restart=Never \
--image aeron/mongosh:latest -- $MONGO_URI
CLI options and everything else is the same here.
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.
The mongosh
is an open-source project made by MongoDB Inc and
its contributors, available under Apache 2.0 license.