Build multiple docker images
Hello,
I have one repository (monorepo) that contains three projects. I want to create docker images for these projects. There is one Dockerfile for each project.
The docker build step in the build configuration gets only one Dockerfile (Path to file). Is there any way building those three Dockerfiles within one Docker-build step?
For now I have one repo with 3 projects. In the future it might be a repo with 5 or more projects. So I don't want to create 3 Docker-build steps for one application, 5 Docker-build steps for another etc.
1 comment
Sort by
Date
Votes
Hello,
It is not possible to build multiple Dockerfiles within one Docker-build step: a single Docker build builds one Docker image.
I did not understand well the scenario that you want to build, but you might want to consider using separate build steps/build configurations. As you scale up, having separate build steps (preferably in separate build configurations) allows you to, when any one fails, re-run only the one that fails while the rest which had worked are already done. Additionally, if "building 3 docker images" fails, you would need to go and investigate which one and why. So keeping them separated is an advantage. It's a small amount of configuration overhead over a substantial improvement in visibility and flexibility.
You can handle having the multiple projects being in the same repository by configuring the necessary VCS settings . You can also consider to use Build Configuration Templates if the build steps are similar to avoid duplication.
As a workaround you could use the Command line build runner .
Please let me know if you have any other questions,
Guilherme
Please sign in to leave a comment.