DockHook allows you to control your Docker containers through a webhook system.
This project was inspired by the excellent projects Dozzle (which allows you to view container logs in real-time and provides basic functionality for starting and stopping containers) and Portainer (a project for deploying and managing complex Docker environments). If you find the current functionality insufficient, you may consider using these projects.
Pull the latest release with:
$ docker pull kekaadrenalin/dockhook:latest
The simplest way to use DockHook is to run the docker container. Also, mount the Docker Unix socket with --volume
to /var/run/docker.sock
and the path to the storages' directory:
$ docker run --name dockhook -d --volume=/var/run/docker.sock:/var/run/docker.sock:ro --volume=./data/:/data/ -p 8888:8080 kekaadrenalin/dockhook:latest
DockHook will be available at http://localhost:8888/.
Here is the Docker Compose file:
version: "3"
services:
dockhook:
container_name: dockhook
image: kekaadrenalin/dockhook:latest
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- ./data/users.yml:/data/users.yml:rw
- ./data/webhooks.yml:/data/webhooks.yml:rw
... or ...
- ./some_data/:/data/
ports:
- 8888:8080
You need to run a command at least once to add a new user to the file storage (which must be accessible to the
container, for example, ./data/users.yml
). The file storage will be created in any case in the volume:
$ docker run --volume=/var/run/docker.sock:/var/run/docker.sock:ro --volume=./data/:/data/ kekaadrenalin/dockhook /dockhook create-user admin --password password --email test@email.net --name "John Doe"
or
$ docker compose exec -it dockhook /dockhook create-user admin --password password --email test@email.net --name "John Doe"
Additionally, you need to create the first webhook interactively to manage the desired container. The available actions
are START
, STOP
, RESTART
, and PULL
(more details can be found in the Actions section):
$ docker run --volume=/var/run/docker.sock:/var/run/docker.sock:ro kekaadrenalin/dockhook create-webhook
or
$ docker compose exec -it dockhook /dockhook create-webhook
You can also quickly filter only the containers started via docker compose
:
$ docker run --volume=/var/run/docker.sock:/var/run/docker.sock:ro kekaadrenalin/dockhook create-webhook --docker-compose-only
or
$ docker compose exec -it dockhook /dockhook create-webhook --docker-compose-only
List of available actions:
START
: starts an existing stopped containerSTOP
: stops an existing running containerRESTART
: restarts an existing running containerPULL
: pulls and updates the latest version of the image and restarts the existing running container
DockHook is distributed under AGPL-3.0-only.