DockerHook is a way to manage your Docker processes using a Webhook!
726
DockerHook is a way to manage your Docker processes using a Webhook!
Getting started with DockerHook is very easy, you simply need a Docker container and no additional configuration is required to get started.
services:
dockerHook:
image: waxer59/dockerhook
container_name: dockerHook
ports:
- "<desired-port>:8080"
restart: always
volumes:
- /var/run/docker.sock:/var/run/docker.sock
DockerHook uses the environment variables to allow you to customize the parameters
CONFIG_PATHstring/etc/dockerhook/dockerhook.ymlSpecify the path where your configuration file is located
A webhook is an HTTP-based callback function, DockerHook accepts GET and POST requests to perform all actions.
This is the shape that the URL must have.
http://exampleurl.com/<docker-service-name>?<query-parameters>
action'start' | 'stop' | 'restart' | 'pull''pull'Specify the action to be done in the service
tokenstringSpecify the access token to control Webhook execution.
Specifies the access token to control the execution of the Webhook if the enable property of auth is set to true.
Configuration properties allow you to mold DockerHook to your needs!
The DockerHook configuration file must have the extension .yml and it looks like this:
config:
labelBased: true
# ...
auth:
tokens:
- token1
- token2
# ...
configlabelBasedbooleanfalseBy default, DockerHook will have access to all containers, you can prevent this behavior by setting this property to true and adding the dockerhook.enable=true tag in the containers where you want DockerHook to have access.
defaultAction'start' | 'stop' | 'restart' | 'pull''pull'Defines the default action to be performed when the Webhook is called without any action in the query parameters
authenablebooleanfalseBy default, DockerHook allows access to all, set this option to true if you want to set up a token access system.
tokensFilestringSpecify the path to the file where you will store your access tokens, these must be separated by line breaks, see example below and the file must be a text file:
token1
token2
In case
tokensFile andtokens are filled both tokens will be merged.
tokens[]stringSpecify your access tokens
In case
tokensFile andtokens are filled both tokens will be merged.
groups[]stringGroups allow you to restrict access to the token, such as allowing it to only be able to start your services.
To create a group it must have the following format: <groupName>:<actions-splitted-by-commas>
Look at the following examples of how a group would be created:
auth:
groups:
- onlyStart:start
- startAndPull:start,pull
Now in order to use this group you have created you will have to create the token as follows: <groupName>:<token>
In case no group name is specified, the access that this token will have will be full.
See the following example to learn how to use groups and tokens together:
auth:
groups:
- onlyStart:start
- startAndPull:start,pull
tokens:
- onlyStart:tok3n
- startAndPull:tekken
The token to be sent to the Webhook must be the token without the group name specification, i.e. this token
onlyStart:tok3nshould be sent to the Webhook astok3n.
Content type
Image
Digest
sha256:8e4599933…
Size
10.6 MB
Last updated
about 1 year ago
docker pull waxer59/dockerhook