Sign inSign up

tedkulp/docker-autobuilder

By tedkulp

•Updated over 2 years ago

Docker Hub's autobuild function on your own infrastructure.

Image
0

1.4K

tedkulp/docker-autobuilder repository overview

⁠docker-autobuild

⁠Description

Docker Hub recently made autobuilds an Pro-only feature. This container does basically the same thing, but on your own infrastructure.

This will:

  • Listen for a push webhook from Github
  • Look in config.json for a matching config entry
  • Pull the repo
  • Checkout the correct commit
  • Build the container
  • Push it to Docker Hub
  • Notify you via various notification methods when it's done
⁠Direct trigger

There is also an option to trigger a build directly without a push event.

Send a GET request to: http://mynodeserver:3000/trigger/projectName/branchName. This will follow the same series of events as the webhook, but will checkout the tip of whatever branch is in the URL.

⁠Deployment

The easiest thing to do is deploy this with docker:

  • Create a config file somewhere:

curl https://raw.githubusercontent.com/tedkulp/docker-autobuilder/master/config/config.yaml.example > config.yaml

  • Modify config file with actual credentials
  • Run w/ docker:

docker run --rm -v /var/run/docker.sock:/var/run/docker.sock -p 3000:3000 -v `pwd`/config.json:/app/config/config.json tedkulp/docker-autobuilder:latest

  • Create push webhook in repository to point to http://mynodeserver:3000/webhook/github and has a content type of application/json.
  • Wait patiently for new docker container to be pushed to Docker Hub

Tag summary

Content type

Image

Digest

sha256:45b1b4476…

Size

686.1 MB

Last updated

over 2 years ago

docker pull tedkulp/docker-autobuilder