I am trying to implement the CI/CD pipeline for my project using Docker, Kubernetes and Jenkins. My application is multi-tenant application in which database application variables everything is different for different tenant.
Application Strategy
When I am building a docker image I am using a Dockerfile. And I keep my Dockerfile inside my SVN code repository. For every tenant, code repository is same. When I am building an image, at that time I need to build different images for different tenant.
Dockerfile implementation
In my docker file I am adding entry point like the following,
ENTRYPOINT ["java", "-jar", "-Dspring.profiles.active=tenant1config" , "TestProject.war"]
If I need to build Docker image for another tenant , need to add
-Dspring.profiles.active=tenant2config
So the entrypoint in the Dockerfile is dynamic.
My Confusion
- For managing entry point command inside the Dockerfile is possible by dynamically?
- Or Do I need to add another Dockerfile for another tenant? And need to run the docker build command separately for separate tenant?
How can I find a good standard way of implementation of this problem?