Tag: mongodb

Can't access to docker mongo without being root

I just installed docker and I could run a mongodb image in a container, without sudo. The port exposed is 27017. I’m now trying to access it from a shell running on the host, but it works only with sudo mongo –port 27017 I don’t want to use sudo. Is it possible?

Cannot connect to MongoDB running in local Docker container

I have this command to start MongoDB in a container: docker run -p 27017:27017 –name cdt-mongo mongo this is from these docs: https://hub.docker.com/_/mongo/ I actually think the -p 27017:27017 is superfluous. anyway. Locally, I run the container in one terminal, and then in another terminal I issue the mongo command, and I get: $ mongo […]

MongoError: connect ECONNREFUSED in Docker

I have my docker-compose orchestration and I’m getting this error: connection error: { MongoError: failed to connect to server [172.17.0.2:27018] on first connect [MongoError: connect ECONNREFUSED 172.17.0.2:27018] This is the code in server.js: mongoose.connect(‘mongodb://mongodb:27018’); This happen only when I customize the command of my docker container: docker-compose.yml: version: “3” services: app: build: ./my-node-app depends_on: – […]

How to pass docker run command line arg to docker-compose?

mongo docker image can be started using some command like this: docker run –name some-mongo -d mongo –auth This works fine, but now my cloud service provider is using docker-compose, and I don’t have access to docker run, all I can do is to modify that .yml file that used with docker-compose. So my question […]

Which Official Docker Image(s) should I use for running an application with multiple dependencies?

I have a ruby on rails web application to deploy, using Docker containers that has the following dependencies. Ruby(v2.3.1) RVM MongoDB (This will eventually run in its own container) Nginx I have tried starting with the official centos:latest image, then installing these dependencies on top of that, but since there are also official images for […]

Execute multiple commands from shell to docker container

I am trying to do in one command, do a bash from docker container, open mongo and make a request with something like ‘db.test.find({});’ I am reading from others similar post without success. This is the command that I am executing. docker exec -it mongoDB bash -c ‘mongo ; use test; db.test.find({})’ And that command […]

Integration Tests with Docker and Bitbucket pipelines

I would like to run my integration tests as a part of the Bitbucket pipelines CI. My integration tests test a NodeJS backend that runs against an empty MongoDB database. To enable this I want to create a Docker Image that Bitbucket pipelines can pull from a docker image repository. My bitbucket-pipelines.yml will be something […]

How to import data to mongodb container and creating an image

I spent a lot of time on a task which seems a simple one. I want to run a monogodb container. then copy csv file in to the container or execute a command from docker file to import the csv file into the mongodb database. I tried using RUN, script.sh but nothing is working. Please […]

Docker – Creating multiple containers/environments with different versions

I’m starting with MongoDB and taking four courses. All of them use different versions of mongodb, python, nodejs, asp.net, mean stack, etc. The structure of my desirable workspace: courses ├─ mongodb_basic │ ├─ hello_world-2.7.py │ └─ data │ └─ db ├─ python-3.6_mongodb │ ├─ getting_started.py │ └─ data │ └─ db ├─ dotnet_and_mongodb │ ├─ […]

Graylog container cannot connect to MongoDB container

I have some troubles setting up Graylog2 under docker. Everything works until I try using authentication. All I get is the following error repeated forever. Trying both root and graylog user (in both graylog and admin db) gives the same result. The log from mongodb says both users are created during setup. But graylog says […]

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