I am working with building a build pipeline to generate an docker image for an Visual studio solution, which consist of multiple projects each with its own docker file.
Is it somehow possible to combine each of these containers into the same image?
You should avoid combining multiple containers into one image. As the answer to this thread pointed that images should be kept light, and run one service per container.
If you need multiple containers to run in your application. You should use Docker Compose to manage those services.
Compose is a tool for defining and running multi-container Docker applications. With Compose, you use a YAML file to configure your application’s services. Then, with a single command, you create and start all the services from your configuration
Here is a simple Docker compose example.
And you can use Docker Compose task to build, push or run multi-container Docker applications in your azure devops pipelines. Check here to learn more about this task.
If docker compose is not fit for your case, You can have a try checking if you can use multiple stage dockerfile to combine these dockerfiles into one. This will end up with a single image when your run docker build.