Dockerize Spring Boot Java app with Kafka, Zookeeper, and MongoDB [closed]

I am a beginner to Docker and web applications in general. I have to Dockerize a large Spring Boot Java app that uses Kafka, Zookeeper, and MongoDB. It also uses the Gradle build tool. What would be the best approach to Dockerize this app? Should I Dockerize it in one image, or a separate image for each component?

Also, how do I incorporate the Gradle build tool in the Dockerfile?

  • Installing Zookeeper on offline openshift
  • Docker (Compose) client connects to Kafka too early
  • Kafka producer configuration and docker
  • Cannot produce message to kafka from service running in docker
  • how can i launch the kafka scheduler using marathon in minimesos?
  • Docker-compose with Storm 0.10.0 and Zookeeper (connection loss)
  • Thanks!

  • Export enviroment docker variable to file
  • Docker Daemon for Windows
  • Expose urls for Docker compose
  • Docker complains about invalid certificate after update to v1.7.0
  • How to bring apache2 default web page im my browser with Dockerfile using jenkins
  • Docker 1.12 Swarm Service External IP
  • One Solution collect form web for “Dockerize Spring Boot Java app with Kafka, Zookeeper, and MongoDB [closed]”

    Since you are using Gradle, there is a docker-gradle-plugin, which you can use to dockerize your Java applications.

    Putting multiple applications in one Docker build is not the way Docker is intended to be used. There are already Docker images available for tools like Kafka, ZooKeeper and MongoDB. You just use them as a separate container and link them to your dockerized/ non-dockerized Java application.

    Also, how do I incorporate the Gradle build tool in the Dockerfile?

    You actually will incorporate Docker Build in Gradle build file. Not the other way around.

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