Command
The command trigger executes a shell command or script whenever container updates are detected.
⚙️ Configuration Variables
WUD_TRIGGER_COMMAND_{trigger_name}_CMD
Requiredstring
The shell command or script path to execute
WUD_TRIGGER_COMMAND_{trigger_name}_SHELL
Optionalpathdefault: /bin/sh
Shell binary path to use for execution
WUD_TRIGGER_COMMAND_{trigger_name}_TIMEOUT
Optionalintegerdefault: 60000
Command execution timeout in milliseconds
info
This trigger also supports all common trigger configuration options (such as thresholds, scheduling, and batching).
🚀 Examples
Run an Inline Shell Command
- Docker Compose
- Docker
services:
whatsupdocker:
image: getwud/wud
environment:
- WUD_TRIGGER_COMMAND_LOCAL_CMD=echo "$${display_name} can be updated to $${update_kind_remote_value}"
docker run \
-e 'WUD_TRIGGER_COMMAND_LOCAL_CMD=echo "${display_name} can be updated to ${update_kind_remote_value}"' \
getwud/wud
Run a Mounted Shell Script
- Docker Compose
- Docker
services:
whatsupdocker:
image: getwud/wud
volumes:
- ./trigger.sh:/wud/trigger.sh:ro
environment:
- WUD_TRIGGER_COMMAND_LOCAL_CMD=/wud/trigger.sh
- WUD_TRIGGER_COMMAND_LOCAL_SHELL=/bin/bash
docker run \
-v ./trigger.sh:/wud/trigger.sh:ro \
-e WUD_TRIGGER_COMMAND_LOCAL_CMD="/wud/trigger.sh" \
-e WUD_TRIGGER_COMMAND_LOCAL_SHELL="/bin/bash" \
getwud/wud
📦 Environment Variables Passed to Command
In Simple Mode (One execution per update)
The following environment variables are exported to the child process:
display_icon: Container display icon (e.g.mdi:docker)display_name: Container display name (e.g.web-app)id: Docker container IDimage_architecture: OS architecture (e.g.amd64,arm64)image_created: Timestamp of image creationimage_digest_repo: Remote image digest SHA-256image_digest_watch: Whether digest watching is activeimage_id: Local Docker image IDimage_name: Image repository name (e.g.library/nginx)image_os: Target operating system (e.g.linux)image_registry_name: Registry identifier in WUDimage_registry_url: Base URL of the container registryimage_tag_semver: Whether tag follows semantic versioningimage_tag_value: Current running tagname: Raw container nameresult_tag: Candidate update tagstatus: Current container status (e.g.running)update_available:trueupdate_kind_kind: Update type (tagordigest)update_kind_local_value: Current local version valueupdate_kind_remote_value: New remote version valueupdate_kind_semver_diff: Semver bump type (major,minor,patch)watcher: Watcher identifiercontainer_json: Full serialized JSON representation of the container object
In Batch Mode (One execution for a batch of updates)
containers_json: Full serialized JSON array containing all updated container objects