dockhook

command module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 27, 2024 License: AGPL-3.0 Imports: 7 Imported by: 0

README

DockHook

DockHook allows you to control your Docker containers through a webhook system.

License

This project was inspired by the excellent projects DockHook (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.

Getting Started

Pull the latest release with:

$ docker pull kekaadrenalin/dockhook:latest
Running DockHook

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:

$ docker run --name dockhook -d --volume=/var/run/docker.sock:/var/run/docker.sock:ro -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:/dockhook/data/users.yml:rw
      - ./data/webhooks.yml:/dockhook/data/webhooks.yml:rw
    ports:
      - 8888:8080
Authorization

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 kekaadrenalin/dockhook create-user admin --password password --email test@email.net --name "John Doe"
Webhooks

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 kekaadrenalin/dockhook create-webhook

You can also quickly filter only the containers started via docker compose:

$ docker run kekaadrenalin/dockhook create-webhook --docker-compose-only
Actions

List of available actions:

  • START: starts an existing stopped container
  • STOP: stops an existing running container
  • RESTART: restarts an existing running container
  • PULL: pulls and updates the latest version of the image and restarts the existing running container

License

DockHook is distributed under AGPL-3.0-only.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL