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?

  • Difference between Docker and CS Docker Engine ?
  • execute docker commands from bash file
  • Eclipse Che not starting up
  • Setting up multiple Docker containers and MongoDB to run in CircleCI
  • Why is docker-compose throwing an error?
  • What are conceptual and practical differences between containers (i.e. docker) and encapsulated packages (i.e. flatpack, snap)?
  • Docker container not starting (docker start)
  • Activate anaconda environment within docker container
  • Can't connect to Neo
  • Docker for Windows error: “Hardware assisted virtualization and data execution protection must be enabled in the BIOS”
  • Swift Perfect Docker Debugging the build process
  • updating docker image given changes to local filesystem
  • 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.