Categorygithub.com/Waxer59/DockerHook
repository
0.1.0
Repository: https://github.com/waxer59/dockerhook.git
Documentation: pkg.go.dev

# Packages

No description provided by the author
No description provided by the author

# README

DockerHook

DockerHook logo

DockerHook is a way to manage your Docker processes using a Webhook!

Get started

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

Environment Variables

DockerHook uses the environment variables to allow you to customize the parameters

CONFIG_PATH

  • Type: string
  • Default: /etc/dockerhook/dockerhook.yml

Specify the path where your configuration file is located

WebHook

A webhook is an HTTP-based callback function, DockerHook only accepts GET requests to perform all actions.

Url

This is the shape that the URL must have.

http://exampleurl.com/<docker-service-name>?<query-parameters>

Query Parameters

action

  • Type: 'start' | 'stop' | 'restart' | 'pull'
  • Default: 'pull'

Specify the action to be done in the service

token

  • Type: string

Specify 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.

Config Properties

Configuration properties allow you to mold DockerHook to your needs!

config

labelBased

  • Type: boolean
  • Default: false

By 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

  • Type: 'start' | 'stop' | 'restart' | 'pull'
  • Default: 'pull'

Defines the default action to be performed when the Webhook is called without any action in the query parameters

removeOldImage

  • Type: boolean
  • Default: false

By default, DockerHook will not delete any images after updating a container by doing a pull. Set this property to true if you want that after updating a container image the previous one will be removed.

auth

enable

  • Type: boolean
  • Default false

By default, DockerHook allows access to all, set this option to true if you want to set up a token access system.

tokensFile

  • Type: string

Specify 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

[!NOTE] In case tokensFile and tokens are filled both tokens will be merged.

tokens

  • Type: []string

Specify your access tokens

[!NOTE] In case tokensFile and tokens are filled both tokens will be merged.

Examples

Check the following examples: