Bitbucket pipeline trigger from dockerhub post webhook?

Issue #15435 closed
Tim
created an issue

I have setup an automated build on Dockerhub, each time it completed building a docker image, I would like it to trigger Bitbucket pipeline to rerun.

May I know how can I achieve this in Bitbucket? Dockerhub provides webhook for each image completion, but I dont know how to integrate it with Bitbucket

Comments (6)

  1. Aneita Yang staff

    Hey Tim,

    We currently don't support builds being triggered by a webhook. Can you help me to better understand your use case for wanting to do this?

    You mention that you build your Docker image on DockerHub. An alternative is to build your Docker image within Pipelines, which eliminates the need for an integration to trigger a separate Pipelines build. Does this solve your use case?

    Aneita

  2. Aneita Yang staff

    Hey Tim,

    How did you go with the alternative of building your Docker image with Pipelines itself?

    I'm going to close off this issue for now, but if you still have questions or feel like this hasn't been resolved, please feel free to reopen the issue.

    Thanks,
    Aneita

  3. Tim reporter

    @Aneita Yang ok i understand the situation, our used case is below:

    the docker image that we build using the automated build on Dockerhub, is used by few of repository as the image for pipeline, so what we want to achieve is, each this image is rebuild at dockerhub, it could trigger the dependent repository to re run the pipeline again, currently we have to do it manually, we want to make it automated

    of course, there is an alternative, which is to use pipeline to build the image instead of Dockerhub, and after pushing this image to docker hub, we can use the REST API for pipeline to trigger a rerun of pipeline.

    we prefer the first method, as it is easier to setup and scale to many repositories

  4. Aneita Yang staff

    Thanks for explaining your use case!

    Issue #13232 is an open feature request that we have to be able to trigger downstream builds - I encourage you to watch / vote for that issue if it is something that you would like to see.

    As a workaround for now, you can try to use a Lambda (or alternative) to convert the Docker webhook into a Pipelines POST request in order to trigger the Pipelines build automatically. For reference, check out our REST API docs.

  5. Log in to comment