I know the procedure and also how to configure an automated docker hub from GitHub or BitBucket.
But what I have to do right now is to create two docker hub repositories called Test/main
and Test/depend
.
The first repository Test/main
is connected with GitHub and whenever there is a new push the image will be automatically build. But I want to trigger another repository Test/depend
whenever there is a change on the Test/main repository.
Is it possible to configure such scenario?
Repositories, that permits us to push images from a local Docker daemon to Docker Hub. And, automated builds, that link to a source code repository and trigger an image rebuild process on Docker Hub at the time when changes are detected in the source code.
From the Repositories page, click into a repository, and click the Builds tab. Click Configure automated builds to edit the repository's build settings. In the Build Rules section, locate the branch or tag you no longer want to automatically build. Click the autobuild toggle next to the configuration line.
Builds: Automatically build container images from GitHub and Bitbucket and push them to Docker Hub. Webhooks: Trigger actions after a successful push to a repository to integrate Docker Hub with other services.
You get one private repository for free with your Docker Hub user account (not usable for organizations you're a member of).
This can be done with DockerHub:
You need to go to the build settings
of Test/depend
, and look for the section Repository Links. It says:
Link your Automated Build to another Docker Hub repository, and when that repository is updated, it will automatically trigger a rebuild of this Automated Build.
So you just have to add Test/main
int the box an you good to go!
I would like to add important information to the answer above.
Repository links do not work with images from the docker library (all image names without a slash / beginning with _/). Apart from that several issues arised in the past which were not taken seriously by Docker Inc, so far (for some of them this means years).
There are multiple issues on GitHub (docker/hub-feedback#518, docker/hub-feedback#1587, partly docker/hub-feedback#1717, docker/hub-feedback#945, docker/hub-feedback#586). In the meantime they added a small hint (that links do not work for official base images) but it is still possible to enable it when your base image is an official image, without any further warning. The hint can only be seen when hovering over the decent info icon.
Some of the issues referenced also indicate that repository links for non official repositories did not work reliably in the past and Docker Inc wasn't very responsive. I recommend to NOT rely on repository links on Docker Hub.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With