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?

  • specifying network ip docker
  • Failing Dockerized Kafka on MacOS
  • How to place secure file in rancher storage?
  • publishing message to external Kafka Broker from docker container
  • How to deploy a echo app to Marathon (on Mesos on Docker on Mac)?
  • confluentinc kafka-zookeeper docker setup not working
  • Thanks!

  • Docker-compose linking service into dockerfile
  • What are the typical uses cases for LXC versus VM?
  • How to change working of top command
  • How to find dependencies before installing a PHP extension with Docker
  • How to run a network-isolated docker container with docker-py?
  • docker-compose: links option not working
  • 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.