Docker events, dispatched as webhooks.
2.4K
Castor monitors the Docker events of multiple Docker servers and dispatches them via HTTP POST requests to the desired WebHooks.
You can tell Castor to monitor unix:///var/run/docker.sock (named as localhost) for Docker events and forward them to https://www.example.com/hooks/docker.
Now, when the following event gets captured by Castor:
{
"from": "image/with:tag",
"id": "container-id",
"status": "start",
"time": 1423339459
}
it will be POSTed to https://www.example.com/hooks/docker with application/json content type and the following payload:
{
"docker_server": "localhost",
"event": {
"from": "image/with:tag",
"id": "container-id",
"status": "start",
"time": 1423339459
}
}
Make sure you are running on a Ubuntu Linux machine with Docker 1.12 (or newer version) and Docker Compose installed.
(Docker for Mac should work as well)
The first step you have to take is clone this repository and cd into it's root directory.
.env fileNext, you will need to create a .env file to store configuration for your Castor installation in environment variable format (see how examples/.env.example is structured).
Now you have to set the following environment variables in your .env file:
POSTGRES_USERPOSTGRES_PASSWORDPOSTGRES_DBREDIS_URLUse the same format with examples/.env.example
Castor allows only members of a GitHub organization to access it's dashboard. For this reason you will need to register a new OAuth application in GitHub.
Then save your application's Client ID, Client Secret and Organization name in the following environment variables respectively in your .env file:
SOCIAL_AUTH_GITHUB_KEYSOCIAL_AUTH_GITHUB_SECRETSOCIAL_AUTH_GITHUB_ORG_NAMEUse the same format with examples/.env.example
Run the following commands to:
docker-compose run --rm web ./bin/bootstrap
docker run --rm -v $(PWD):/mnt/castor -w /mnt/castor/castor/web/static/web node:8 npm install
Now all you have to do is launch castor by running:
docker-compose up
Now you can visit the Django admin panel, sign in with the superuser credentials that you created before and add Docker servers for monitoring and web hooks for dispatching events captured on those servers.
⚠️ Warning: This will run Castor in development mode, and it will bind /var/run/docker.sock into the container to bind easily to a local Docker daemon. It is suggested strongly to create your own docker-compose.yaml file for your production deployment of Castor.
Castor is licensed under the MIT License. More info at LICENSE file.
Content type
Image
Digest
Size
407.9 MB
Last updated
over 5 years ago
docker pull sourcelair/castor