Public | Automated Build

Last pushed: 2 years ago
Short Description
Short description is empty for this repo.
Full Description


Automatic Docker Deployment via Webhooks

docker-hook listens to incoming HTTP requests and triggers your specified command.


  • No dependencies
  • Super lightweight
  • Dead simple setup process
  • Authentification support


1. Prepare Your Server

Download docker-hook

No worries - it just downloads a Python script. There won't be anything installed or written elsewhere.

$ curl > /usr/local/bin/docker-hook; chmod +x /usr/local/bin/docker-hook

Start docker-hook

$ docker-hook <auth-token> <command>

Please choose a secure auth-token string or generate one with $ uuidgen. Keep it safe or otherwise other people might be able to trigger the specified command.


The command can be any bash command of your choice. See the following example. This command will be triggered each time someone makes a HTTP request.

2. Configuration On Docker Hub

Add a webhook like on the following image. can be the domain of your server or its ip address. docker-hook listens to port 8555. Please replace my-super-safe-token with your auth-token.


This example will stop the current running yourname/app container, pull the newest version and start a new container.

$ docker-hook my-super-safe-token ./

#! /bin/bash

docker ps | grep $IMAGE | awk '{print $1}' | xargs docker stop
docker pull $IMAGE
docker run -d $IMAGE

You can now test it by pushing something to yourname/app or by running the following command where is either a domain pointing to your server or just its ip address.

$ curl -X POST

How it works

docker-hook is written in plain Python and does have no further dependencies. It uses BaseHTTPRequestHandler to listen for incoming HTTP requests from Docker Hub and then executes the provided command if the authentification was successful.


This tool was built as a proof-of-concept and might not be completly secure. If you have any improvement suggestions please open up an issue.


MIT License

Docker Pull Command
Source Repository