How do I install only mongodb-org-shell and not mongodb in alpine?

Viewed 3442

How can I install just a mongo client shell on docker alpine using which I can connect to mongodb on another server?
This is to reduce the size of my image.

1 Answers

To run a shell session:

$ docker exec -ti mongo sh To use the mongo shell client:

$ docker exec -ti mongo mongo The mongo shell client can also be run its own container:

$ docker run -ti --rm --name mongoshell mongo host:port/db

Related