Sign inSign up

garfieldwtf/telegram-docker2

By garfieldwtf

โ€ขUpdated about 1 year ago

This container monitors Docker events and sends notifications to a Telegram chat via bot.

Image
Monitoring & observability
0

4.3K

garfieldwtf/telegram-docker2 repository overview

โ ๐Ÿš€ Docker Monitor with Telegram Bot

This container monitors Docker events and sends notifications to a Telegram chat via bot.

โ ๐Ÿ”ง Environment Variables
VariableDescription
TELEGRAM_BOT_TOKENYour Telegram bot token
TELEGRAM_CHAT_IDYour Telegram chat ID (group or user)
MONITOR_INTERVAL(Optional) Event check interval in seconds. Default: 5

Note: Ensure the bot has permission to send messages to the chat ID.


โ ๐Ÿณ Run the Container
docker run -itd \
  --name docker-monitor \
  --restart unless-stopped \
  --user root \
  -v /var/run/docker.sock:/var/run/docker.sock \
  -e TELEGRAM_BOT_TOKEN="your_bot_token" \
  -e TELEGRAM_CHAT_ID="your_chat_id" \
  -e MONITOR_INTERVAL=5 \
  garfieldwtf/telegram-docker2:latest

โ โœ… Example

Replace the values with your actual Telegram credentials:

docker run -itd \
  --name docker-monitor \
  --restart unless-stopped \
  --user root \
  -v /var/run/docker.sock:/var/run/docker.sock \
  -e TELEGRAM_BOT_TOKEN="123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11" \
  -e TELEGRAM_CHAT_ID="-1001234567890" \
  -e MONITOR_INTERVAL=10 \
  garfieldwtf/telegram-docker2:latest

โ ๐Ÿ“ฆ Image

โ ๐Ÿงช Testing Your Bot
  1. Start the container.
  2. Run docker stop or docker start on any container.
  3. You should receive a message in your Telegram chat.

Tag summary

Content type

Image

Digest

sha256:40f80647cโ€ฆ

Size

33.1 MB

Last updated

about 1 year ago

docker pull garfieldwtf/telegram-docker2