Installing mongo client in a Docker container

I am using fig to build and run my app within various Docker containers and so-far, so good.

I have a container for my app and a db container with mongo in it.

  • How to send logs from tomcat docker container to catalina.out?
  • Limit Disk usage in Docker+MongoDB
  • search on my Auth+TLS private docker registry
  • import mysql data to kubernetes pod
  • Trying to create an automated docker build
  • Is there a way to add the Docker host to a container's /etc/hosts using docker-compose?
  • But now I am trying to connect to the mongo server to seed it with a user and database and I can’t find how to install the mongo client.

    My app’s image is derived from the standard dockerfile/nodejs image and that does not include a mongo client.

    Trying RUN mongo just gives an error mongo not found.

    All the documentation I’ve turned up so far relates to how to install the mongo server within a Docker container, and nothing I;ve found so far tells me how to install the mongo client. How do I do this?

  • docker mongodb replication on same server
  • executable file not found in $PATH when trying to connect to a container in an AWS ECS EC2 instance
  • AngularJS and NodeJS app in Docker
  • Difference between Rancher and other container orchestration
  • Docker Data Volumes and Mounting to Host
  • haproxy not routing to service
  • One Solution collect form web for “Installing mongo client in a Docker container”

    What about:

    RUN sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
    RUN sudo apt-get install -y mongodb-org-shell
    RUN sudo apt-get install -y mongodb-org-tools
    

    as suggested here?

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.