A lightweight HTTP API to automate CI/CD using Docker Hub .
Puller is a minimal HTTP API service that listens for Docker Hub webhook payloads and, pulls and redeploys a specified container.
It's designed to be lightweight, easy to configure, and suitable for use in CI/CD pipelines.
This lets you automatically redeploy containers whenever you push a new image tag to Docker Hub, without manual intervention.
docker pull and docker-compose up on-demand.Clone & Deploy
git clone https://github.com/ehzack/puller-dockerhub.git
cd puller-dockerhub
docker-compose up -d
Configure Webhook on Docker Hub
See Integrate with Docker Hub below.
Push a New Tag
docker tag my-app:latest youruser/my-app:release-1.0
docker push youruser/my-app:release-1.0
Puller will automatically pull and redeploy your container.
| Variable | Default | Description |
|---|---|---|
SERVER_PORT | 4999 | HTTP port on which Puller listens. |
RETRY_COUNT | 3 | Number of times to retry a failed docker pull. |
COMPOSE_SERVICE | none | (Optional) Service name for docker-compose up. |
LOG_LEVEL | info | Logging level: debug, info, warn, error. |
LOG_MAX_SIZE | 3 | Maximum size of log files in MB. |
LOG_MAX_FILES | 3 | Maximum number of log files to retain. |
version: "3.8"
services:
puller:
image: ehzack/puller-dockerhub:latest
restart: always
ports:
- "${SERVER_PORT:-4999}:4999"
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
environment:
SERVER_PORT: 4999
LOG_MAX_SIZE: 3 # in MB
LOG_MAX_FILES: 3
You can manually trigger a pull & deploy:
curl -X POST "http://<HOST>:<PORT>/trigger" -H "Content-Type: application/json" -d '{
"image": "youruser/my-app:latest",
"composeService": "web"
}'
image: Full image reference (<repo>:<tag>).composeService: (Optional) Overrides COMPOSE_SERVICE env var.http://<PULLER_HOST>:<PULLER_PORT>/trigger?path=$path$&container_name=$container_name
Query Parameters:
Example URL:
Configure Compose Service
Ensure your docker-compose.yml defines the service you want to restart:
version: "3.8"
services:
web:
image: youruser/my-app:latest
# ...
Push New Image
Every docker push will send a webhook to Puller. It will:
repository and push_data.tag.docker pull youruser/my-app:<tag>.docker-compose up -d web.GET /health returns 200 OK if service is healthy.docker logs -f puller-dockerhub_puller_1
sudo chmod 660 /var/run/docker.sock
sudo usermod -aG docker $(whoami)
COMPOSE_SERVICE matches your service name in docker-compose.yml.We welcome your improvements and bug fixes! Please see CONTRIBUTING.md.
This project is licensed under the MIT License. See LICENSE.
Content type
Image
Digest
sha256:20663aad8…
Size
156.8 MB
Last updated
over 1 year ago
docker pull zackprod/puller-dockerhub