sdab - Selfhosted Docker Automated Builds
sdab has not been very widely tested yet but it seems to works quite well for ~10 projects I use it in.
View on Docker Hub
sdab is a Node.js app to automatically build Dockerfiles that are in Github repos.
You need to be connected to the Docker Hub and have Docker installed on your computer.
Now, run the following in a Terminal:
docker run -p 3000:3000 \ -v $HOME/.ssh:/root/.ssh \ -v /var/run/docker.sock:/var/run/docker.sock \ -v $HOME/.docker/config.json:/root/.docker/config.json \ ronthecookie/sdab
It will now listen on port
So far I have only tested this on Linux, if you have tested this on another OS and it works fine, please do open a Issue informing me of this.
Deploying this is not very different then running it on your Computer, if at all.
- A Server running Linux with:
- A SSH Keypair
- Access to a Registry like Docker Hub or your own.
docker run -p 6000:3000 \ -v /path/to/ssh/keypair/folder:/root/.ssh \ -v /var/run/docker.sock:/var/run/docker.sock \ -v /PATHTO/YOURHOMEDIR/.docker/config.json:/root/.docker/config.json \ ronthecookie/sdab
- Change the
6000to the external (exposed) port number you desire.
/path/to/ssh/keypair/folderto where your SSH Key Pair is (Ex:
/PATHTO/YOURHOMEDIRto where your home directory is (You can find this out by running
echo $HOMEin a terminal)
- Run it!
Now that your sdab instance is running, you have to go into your Github Repo's settings and select Webhooks -> Add webhook then
- Fill out the payload url with your server's URL with the path being /webhook
- Choose content type "application/json"
- Enter a random string that will be your new Github Webhook secret, behave like it is your password.
- Select "Just the
pushevent" and add the Webhook - if you see a nice
✔️emoji then success!
Docker Compose Example
version: 3 services: sdab: ports: - '6000:3000' volumes: - '/path/to/ssh/keypair/folder:/root/.ssh' - '/var/run/docker.sock:/var/run/docker.sock' - '/pathTo/yourHomeDirectory/.docker/config.json:/root/.docker/config.json' image: ronthecookie/sdab
"docker run" command argument customization guide (badly written)
THIS IS BADDLY WRITTEN, You have been warned.
If this is a private git repo - you will need to point it to an ssh key pair with the
Now, you'll need a port to expose
-p 6000:3000 where 6000 is your port.
Those are all of the important arguments done, now you just need to run
docker login (or
docker login registry.example.com if you are connecting to a registry other than Docker Hub)
- Docker Hub's Automated Builds for the idea.