Docker MongoDB error : Can't call something

I have Dockerized MongoDB and trying to access it from another container running on the same host. But i am getting the following error on the container:

com.mongodb.MongoException$Network: can't call something : /1.2.3.4:27017/admin
        at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:227)
        at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:305)
        at com.mongodb.DB.command(DB.java:160)
        at com.mongodb.DB.command(DB.java:183)
        at com.mongodb.DB.command(DB.java:144)
        at com.mongodb.DB.command(DB.java:195)
        at com.mmi.epg.utils.MongoDB.getDbVersion(MongoDB.java:117)
        at com.mmi.epg.utils.MongoDB.<init>(MongoDB.java:73)
        at com.mmi.epg.utils.MongoDB.getInstance(MongoDB.java:105)
Caused by: java.io.EOFException
        at org.bson.io.Bits.readFully(Bits.java:37)
        at org.bson.io.Bits.readFully(Bits.java:28)
        at com.mongodb.Response.<init>(Response.java:39)
        at com.mongodb.DBPort.go(DBPort.java:128)
        at com.mongodb.DBPort.call(DBPort.java:79)
        at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:218)
        ... 13 more

Where fcdfd39baedb is the service container which access the mongoDB. I have this line in mongod.conf.

  • Docker rails run server
  • How to define a disk quota for docker containers?
  • How to pass environment variable values into files in the docker container I'm trying to run
  • How to copy files to each user's space in docker
  • Kubernetes docker sample does not expose a port
  • Test docker clusters locally
  • #bind_ip=127.0.0.1
    

    Why did the service use an Internal IP address and had container ID before that to call MongoDB instance ? Am i doing something wrong here ?

    Update: Please find my Dockerfile below

    FROM tveuser/tve-repository:tve-centos
    MAINTAINER karthik.jayaraman "karthik.jayaraman@xyz.com"
    
    VOLUME ["/data/db"]
    
    # Expose port #27017 from the container to the host
    EXPOSE 27017
    
    ADD /scripts/mongodb.repo /etc/yum.repos.d/
    
    ADD /conf/mongod.conf /etc/
    
    ADD supervisord.conf /etc/
    
    RUN yum install -y mongo-10gen mongo-10gen-server &&\
        mkdir -p /data/db
    
    CMD supervisord -c /etc/supervisord.conf
    

    Update

    I have updated my question. I could telnet the IP and Port number from my service but unable to connect to MongoDB. Would appreciate some help.

  • Get all containers/images using docker-java client library [closed]
  • Boot2Docker for OS X fails to start
  • Running multiple GUIs in Docker using X11 forwarding
  • Switching between docker tags
  • inotifywait with Docker command and variable
  • How to configure dns entries for Docker Compose
  • Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.