{"id":13581877,"url":"https://github.com/hasnat/docker-events-notifier","last_synced_at":"2026-01-12T03:03:27.844Z","repository":{"id":56027347,"uuid":"189713866","full_name":"hasnat/docker-events-notifier","owner":"hasnat","description":"Docker events notifier","archived":false,"fork":false,"pushed_at":"2024-07-23T09:51:25.000Z","size":604,"stargazers_count":17,"open_issues_count":3,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-10-12T15:54:13.755Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hasnat.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-06-01T09:22:56.000Z","updated_at":"2025-10-06T09:04:39.000Z","dependencies_parsed_at":"2024-11-05T21:33:47.625Z","dependency_job_id":null,"html_url":"https://github.com/hasnat/docker-events-notifier","commit_stats":{"total_commits":12,"total_committers":2,"mean_commits":6.0,"dds":0.08333333333333337,"last_synced_commit":"df9d898528d1261e6869a45dc6a0629383f98e23"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/hasnat/docker-events-notifier","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hasnat%2Fdocker-events-notifier","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hasnat%2Fdocker-events-notifier/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hasnat%2Fdocker-events-notifier/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hasnat%2Fdocker-events-notifier/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hasnat","download_url":"https://codeload.github.com/hasnat/docker-events-notifier/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hasnat%2Fdocker-events-notifier/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28332853,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T00:36:25.062Z","status":"online","status_checked_at":"2026-01-12T02:00:08.677Z","response_time":98,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T15:02:17.564Z","updated_at":"2026-01-12T03:03:27.829Z","avatar_url":"https://github.com/hasnat.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# docker-events-notifier\nDocker events notifier\n\nSlack, Discord or Email notifications for docker events on your host, \u003c 10mb image, no exposed ports.\n\nGeneral http webhooks like POST requests possible, e.g. \n- slack.json uses application/x-www-form-urlencoded with data key `payload`\n  - mattermost would be similar to slack\n- discord.json uses application/json\n\ndocker hub: `hasnat/docker-events-notifier`\nhttps://hub.docker.com/r/hasnat/docker-events-notifier/\n\n## Example notifications\n![docker-events-notifier-slack](https://raw.githubusercontent.com/hasnat/docker-events-notifier/master/docker-events-notifier-screenshot-slack.png)\n![docker-events-notifier-discord](https://raw.githubusercontent.com/hasnat/docker-events-notifier/master/docker-events-notifier-screenshot-discord.png)\n![docker-events-notifier-email](https://raw.githubusercontent.com/hasnat/docker-events-notifier/master/docker-events-notifier-screenshot-email.png)\nLook for config.xml, template/*.json for email, slack, discord templates\n## Configurations \u0026 notifiers templates\n- [config.yml](https://github.com/hasnat/docker-events-notifier/blob/master/config.yml) \n  - path to notifier body templates and urls to send notification to.\n  - configurations on when to fire notification on which notifier\n \n\n- [email template](https://github.com/hasnat/docker-events-notifier/blob/master/templates/email.txt)\n\n- [slack template](https://github.com/hasnat/docker-events-notifier/blob/master/templates/slack.json)\n- [discord template](https://github.com/hasnat/docker-events-notifier/blob/master/templates/discord.json)\n\nDocker events Reference\n- https://docs.docker.com/engine/reference/commandline/events/\n\n## Example usage\nCli, making sure you have copy of templates and config.yml in current directory\n```\ndocker run -it \\\n    --name docker-events-notifier \\\n    -e HOST_TAG=local \\\n    -e DOCKER_API_VERSION=1.43 \\\n    -e RLOG_LOG_LEVEL=DEBUG \\\n    -v \"/var/run/docker.sock:/var/run/docker.sock\" \\\n    -v \"$(pwd)/config.yml:/etc/docker-events-notifier/config.yml\" \\\n    -v \"$(pwd)/templates:/etc/docker-events-notifier/templates\" \\\n    hasnat/docker-events-notifier\n```\nCompose\n```\nversion: '2'\n\nservices:\n\n  docker-events-notifier:\n    image: hasnat/docker-events-notifier\n    container_name: docker-events-notifier\n    environment:\n      HOST_TAG: local\n      DOCKER_API_VERSION: \"1.43\"\n      RLOG_LOG_LEVEL: DEBUG\n    volumes:\n      - \"/var/run/docker.sock:/var/run/docker.sock\"\n      - \"./config.yml:/etc/docker-events-notifier/config.yml\"\n      - \"./templates:/etc/docker-events-notifier/templates\"\n\n```\n\n## Local build\nRun \u0026 develop locally by, check [docker-compose.override.yml](https://github.com/hasnat/docker-events-notifier/blob/master/docker-compose.override.yml)\n\n`docker-compose up --build`\n\n## Example config.yml\nDesign you config by looking into `docker events` \u0026 `jq` command\n```yaml\n\nnotifiers:\n  slack:\n    url: \"https://hooks.slack.com/services/XXXX\"\n    template: /etc/docker-events-notifier/templates/slack.json\n    data_encoding: urlencode.payload\n  discord:\n    url: \"https://hooks.discord.com/services/XXXX\"\n    template: /etc/docker-events-notifier/templates/discord.json\n    data_encoding: json\n  email:\n    url: \"smtp://user:pass@some.mail.host:587?from=sender@example.net\u0026to=recipient1@example.net\u0026to=recipient2@example.net\"\n    template: /etc/docker-events-notifier/templates/email.txt\n\n\n\n# global filters ( check https://docs.docker.com/engine/reference/commandline/events/#filter-events-by-criteria )\n# anything not matching this would be ignored\nfilters:\n  event: [\"start\", \"stop\", \"die\", \"destroy\"]\n#  container: [\"some_container_name\"]\n#  image: [\"hasnat/docker-events-notifier\"]\n\n\n\nnotifications:\n  - title: \"Alert me when tianon/.* based container dies with exitCode 1\"\n    when_regex:\n      status: [\"(die|destroy)\"]\n      \"Actor.Attributes.image\": [\"tianon/.*\"]\n    when:\n      \"Actor.Attributes.exitCode\": [\"1\"]\n    notify:\n      - email\n      - slack\n      - discord\n\n  - title: \"Alert only on slack when container dies with exitCode 0\"\n    when_regex:\n      status: [\"(die|destroy)\"]\n      \"Actor.Attributes.image\": [\"hasnat/.*\"]\n    when:\n      \"Actor.Attributes.exitCode\": [\"0\"]\n    notify:\n      - slack\n      - discord\n\n  - title: \"Alert me on anything happening to images by hasnat\"\n    when_regex:\n      \"Actor.Attributes.image\": [\"hasnat/.*\"]\n    notify:\n      - email\n      - slack\n\n```\n\n### TODO:\n- Allow https or local unix socket for docker host\n- Group notifications / rate-limit sending\n- Split secrets (notifiers) from Config\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhasnat%2Fdocker-events-notifier","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhasnat%2Fdocker-events-notifier","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhasnat%2Fdocker-events-notifier/lists"}