Docker Community Forums

Share and learn in the Docker community.

Build only specific image from git repo

dockerhub

(Krystalcode) #1

Hello,

I have all of my image definitions in one Git repository. I have created several Automated Builds on Docker Hub that each correspond to a folder in the Git repository. Whenever I push to the remote repository (Github), all of the images are rebuilt, even if I have updated only one.

This makes the builds extremely slow and it puts unnecessary strain to Docker servers. Having 30+ separate git repositories is not good option …

Is there a way to tell Docker Hub to rebuild an image only if the specified folder has changed? I don’t think it would be too difficult to detect the latest commit that has affected the specified folder and compare its timestamp with the latest automated build.


(Krystalcode) #2

Additionally, it would be great to be able to specify the path to the README file as well. It picks up the main README file that refers to all repositories/images in that use case …


(Harmish Khambhaita) #3

This was possible before some time. For example look at https://hub.docker.com/r/harmish/ros/, where the automated build name and source repository name is different. I was able to name automated build whatever I want, and link them to Dockerfiles inside different direcotories of same github repository.

However, it seems this ‘feature’ is not available anymore. New automated build must have same repository name on github. It would be helpful if someone could explain the reason behind this change.


(Krystalcode) #4

Yeah, I’ve come across a few images pointing to sub-directories in a repository and I was wondering how they were able to do it …