{"id":36741285,"url":"https://github.com/devodev/docker-inotify","last_synced_at":"2026-01-12T12:28:59.188Z","repository":{"id":125010373,"uuid":"365546175","full_name":"devodev/docker-inotify","owner":"devodev","description":"A lightweight utility to monitor filesystem events and run a script on matching conditions.","archived":false,"fork":false,"pushed_at":"2025-11-01T14:31:05.000Z","size":27,"stargazers_count":10,"open_issues_count":0,"forks_count":5,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-01T16:14:50.551Z","etag":null,"topics":["alpine","configmap","inotify","inotifywait","inotifywatch","kubernetes","reload-config"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/devodev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2021-05-08T15:18:02.000Z","updated_at":"2025-11-01T14:31:07.000Z","dependencies_parsed_at":"2025-05-19T02:47:56.210Z","dependency_job_id":null,"html_url":"https://github.com/devodev/docker-inotify","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/devodev/docker-inotify","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devodev%2Fdocker-inotify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devodev%2Fdocker-inotify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devodev%2Fdocker-inotify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devodev%2Fdocker-inotify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devodev","download_url":"https://codeload.github.com/devodev/docker-inotify/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devodev%2Fdocker-inotify/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28338976,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T12:22:26.515Z","status":"ssl_error","status_checked_at":"2026-01-12T12:22:10.856Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["alpine","configmap","inotify","inotifywait","inotifywatch","kubernetes","reload-config"],"created_at":"2026-01-12T12:28:59.121Z","updated_at":"2026-01-12T12:28:59.176Z","avatar_url":"https://github.com/devodev.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# docker-inotify\n\n[![Version](https://img.shields.io/docker/v/devodev/inotify?color=brightgreen\u0026label=version)](https://github.com/devodev/docker-inotify)\n[![Version](https://img.shields.io/docker/image-size/devodev/inotify)](https://github.com/devodev/docker-inotify)\n[![Docker Pulls](https://img.shields.io/docker/pulls/devodev/inotify.svg)](https://hub.docker.com/r/devodev/inotify/)\n[![Docker Stars](https://img.shields.io/docker/stars/devodev/inotify.svg)](https://hub.docker.com/r/devodev/inotify/)\n\n## Quick reference\n\n- **Maintained by**: [devodev](https://github.com/devodev)\n\n## Supported tags and respective `Dockerfile` links\n\n- [`0.4.0`, `0.4`, `latest`](https://github.com/devodev/docker-inotify)\n\n## Quick reference (cont.)\n\n- **Where to file issues**: [https://github.com/devodev/docker-inotify/issues](https://github.com/devodev/docker-inotify/issues)\n\n## What is Inotify?\n\n\u003e GitHub repository: \u003chttps://github.com/inotify-tools/inotify-tools\u003e\n\nFrom the linux man pages (\u003chttps://man7.org/linux/man-pages/man7/inotify.7.html\u003e):\n\n*The inotify API provides a mechanism for monitoring filesystem events. Inotify can be used to\nmonitor individual files, or to monitor directories. When a directory is monitored, inotify will\nreturn events for the directory itself, and for files inside the directory.*\n\nTwo command-line tools are distributed as part of the `inotify-tools` package (`inotifywait`,\n`inotifywatch`) and allows to interact with the Inotify API.\n\n## How to use this image\n\n`docker-inotify` provides an Alpine-based image that contains the `inotify-tools` package, as well\nas `bash` and a series of network-related command-line utilities such as `curl`, `netcat`, etc. It\nalso includes a lightweight `inotifywait.sh` script that can watch files and/or directories and send\nevents to a user-defined script. The script can be entirely configured through environment\nvariables.\n\nThe main use-case for this image is to provide an easy way to trigger an action based on a\nconfiguration file change. All you need to do is mount a volume in the sidecar to be monitored, and\nprovide a script to trigger when an event is received.\n\n### How it works\n\nAn `inotifywait` process watches INOTIFY_TARGET, and runs INOTIFY_SCRIPT with the triggered event\ndata as arguments.\n\nWhen using the default configuration values, the script will receive:\n\n| argv | name                                    |\n| ---- | --------------------------------------- |\n| `$1` | timestamp                               |\n| `$2` | watched file/directory path             |\n| `$3` | event name(s)                           |\n| `$4` | filename (if a directory is monitored)  |\n\n#### Arguments examples\n\n\u003e Watched events: `modify delete delete_self`\n\nA watched file being modified/deleted\n\n```bash\n22:48:36 /test MODIFY\n22:48:36 /test DELETE_SELF\n```\n\nA file being modified/deleted in a watched directory\n\n```bash\n22:48:36 /test/ MODIFY a_file\n22:48:36 /test/ DELETE a_file\n```\n\nThe following section describes how to configure the watch process.\n\n### Environment variables\n\n#### Global\n\n| Variable       | Required | Default value | Description                                |\n| -------------- | -------- | ------------- | ------------------------------------------ |\n| INOTIFY_TARGET | true     | empty         | The file or directory to watch for events  |\n| INOTIFY_SCRIPT | true     | empty         | The script to run whenever an event occurs |\n| INOTIFY_QUIET  | false    | true          | If set, suppress log messages              |\n\n#### Watch configuration\n\n\u003e The default values should be fine in most cases.\n\u003e\n\u003e See [inotify-tools](https://github.com/inotify-tools/inotify-tools) for more details about\n\u003e `inotifywait` available flags.\n\u003e\n\u003e Booleans can be set to any value to be considered true.\n\n| Variable               | Default value               | Description                                                         |\n| ---------------------- | --------------------------- | ------------------------------------------------------------------- |\n| INOTIFY_CFG_CSV        | false                       | (bool) Output events using CSV format                               |\n| INOTIFY_CFG_EVENTS     | `modify delete delete_self` | Space-separated list of events to watch                             |\n| INOTIFY_CFG_EXCLUDE    | -                           | Exclude a subset of files using a POSIX regex pattern               |\n| INOTIFY_CFG_EXCLUDEI   | -                           | Same as `INOTIFY_CFG_EXCLUDE` but case insensitive                  |\n| INOTIFY_CFG_INCLUDE    | -                           | Include a subset of files using a POSIX regex pattern               |\n| INOTIFY_CFG_INCLUDEI   | -                           | Same as `INOTIFY_CFG_INCLUDE` but case insensitive                  |\n| INOTIFY_CFG_QUIET      | true                        | (bool) Suppress inotifywait logging                                 |\n| INOTIFY_CFG_RECURSIVE  | false                       | (bool) Watch all subdirectories with unlimited depth                |\n| INOTIFY_CFG_TIMEFMT    | `%H:%M:%S`                  | The strftime-compatible pattern used to display %T in emitted event |\n| INOTIFY_CFG_TIMEOUT    | -                           | Timeout and re-setup watchers after X seconds of no event received  |\n\n### Example\n\n#### Kubernetes\n\nThe following example defines a `Pod` containing an application container and an `inotify` sidecar\nthat will be used to trigger a server reload whenever the mounted configuration file (here a shared\n`ConfigMap`) is updated.\n\n```yaml\n---\napiVersion: v1\nkind: ConfigMap\nmetadata:\n  name: application-conf\ndata:\n  application.conf: |-\n    [server]\n    property=value\n---\napiVersion: v1\nkind: ConfigMap\nmetadata:\n  name: inotify-example-reload-script\ndata:\n  reload-server.sh: |-\n    #!/usr/bin/env bash\n\n    timestamp=\"$1\"; shift\n    file=\"$1\"; shift\n    event=\"$1\"; shift\n\n    echo \"[${timestamp}] file: ${file} changed (${event}), triggering server reload\"\n    curl -s -X POST http://localhost:8080/reload\n---\napiVersion: v1\nkind: Pod\nmetadata:\n  name: inotify-example\nspec:\n  containers:\n  - name: application\n    image: application/server:latest\n    ports:\n      - containerPort: 8080\n        name: server\n    volumeMounts:\n      - name: conf\n        mountPath: /conf/application.conf\n        readOnly: true\n        subPath: application.conf\n  - name: reload-server-sidecar\n    image: devodev/inotify:latest\n    env:\n      - name: INOTIFY_TARGET\n        value: \"/conf/application.conf\"\n      - name: INOTIFY_SCRIPT\n        value: \"/reload-server.sh\"\n    volumeMounts:\n      - name: conf\n        mountPath: /conf/application.conf\n        readOnly: true\n        subPath: application.conf\n      - name: reload-script\n        mountPath: /reload-server.sh\n        readOnly: true\n        subPath: reload-server.sh\n  volumes:\n    - name: conf\n      configMap:\n        name: application-conf\n    - name: reload-script\n      configMap:\n        name: inotify-example-reload-script\n        # makes sure the script is executable\n        defaultMode: 0777\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevodev%2Fdocker-inotify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevodev%2Fdocker-inotify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevodev%2Fdocker-inotify/lists"}