Docker Community Forums

Share and learn in the Docker community.

Build Multiple Dockerfiles in one GitHub Repo?


(Henfri) #1

Hello,

I am wondering what the correct way is to share and automatically build (on Docker-hub) the images for a complete docker-compose set of containers by docker hub.
Concretely, I want to build all of this: https://github.com/henfri/docker/tree/master/knx

In this yml, several Docker-Files are referenced.
Do I need to create a Github-Repository for each Dockerfile, or is there a way to keep all together in one Github-Rpository?

Greetings,
Hendrik


(Henfri) #2

Hello,

I did find the solution. In the Build-Settings more than one Build can be specified.
You can either select different branches of your git, or specify a Dockerfile.
I did see that before my post, but I didn’t think that this was meant to compile different Images, but just different revisions of one Image. And in fact, that is right.
Also I did try to create more than one Automated Build with the same github linked. That worked, but I could not specify the right Dockerfile via the beforementioned way.
The reason is, that you don’t have to specify the path/to/ the dockerfile, but the /path/to/Dockerfile. I.e. you need to specify pathname and Filename.

Then, it works

Greetings,
Hendrik