Skip to content

Instantly share code, notes, and snippets.

@nathancahill
Last active January 3, 2017 20:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nathancahill/ffc679177a3d18ec8a6ef2b3a700b4b6 to your computer and use it in GitHub Desktop.
Save nathancahill/ffc679177a3d18ec8a6ef2b3a700b4b6 to your computer and use it in GitHub Desktop.

Trigger Docker Build from 3rd-party Github Repo Push

Docker Hub allows you to automate builds from your own repo. They also allow builds to be triggered when existing Docker images are updated.

My image depends on Ubuntu (tracked via Docker), Node (tracked via Docker) and Kosmtik. Since there isn't an official Kosmtik image, Docker Hub doesn't have to trigger new builds when the repo is updated. Enter IFTTT. Although the service was massively downgraded when they pivoted towards "Applets" 🤔 -- most of the original functionality is now in the Maker service.

Using the Feed service to subscribe to a Github repo's commit log:

https://github.com/<username>/<repo>/commits/master.atom

We can trigger builds by firing a POST at Docker Hub's Build webhook! 🎉

https://registry.hub.docker.com/u/<username>/<repo>/trigger/<key>/

Disclaimer: Feeds are polled by IFTTT and might be delayed up to an hour. Docker Hub Build triggers are rate-limited, if a current build is in progress, new pushes are ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment