Docker – Karaf image with Mongo Image

I have created the karaf dockerfile from scratch and it works with my application. Now, the postgreSQL and the MongoDB containers need to be running on the same network as the karaf container for the final step. Essentially, what i have so far is three separate dockerfiles. And what i need is for them to be able to communicate with each other. How do i approach this?

  • Chef-zero error when creating a docker container from OSX
  • In docker-compose how to create an alias / link to localhost?
  • In jenkins, docker-compose mysql 0mERROR 1396 (HY000) at line 1: Operation CREATE USER failed for 'root'@'%'
  • Correct pulling edxops/forums way
  • Different localhost ports causes failed Access-Control-Allow-Origin
  • Node cannot join Swarm Cluster
  • How will a server running multiple Docker containers handle the TCP limitations?
  • Dockerized Mongo takes ages to load then doesn't run mongo
  • Docker run cannot publish port range despite netstat indicates that ports are available
  • Mesos slave won't start docker
  • How to commit changed data in a mysql container to a new image
  • How can I have MySQL persist on CoreOS Updates?
  • One Solution collect form web for “Docker – Karaf image with Mongo Image”

    Use docker network ls command firstly, it will show the networks exist in the machine.
    Then run your MongoDB container and set --net param.

    docker run --net karaf_default mongo

    The mongo and karaf will be in the same network now. (you can check doc of --link)

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