Debian Codegraph @

docs/usage/docker/index.md

raw
1 # Using Shoutrrr as a Docker Container
2
3 ## Overview
4
5 The Shoutrrr Docker image provides a lightweight containerized version of the Shoutrrr CLI. It supports all architectures (amd64, arm64, arm/v6, i386, riscv64) and is available on Docker Hub (`nickfedor/shoutrrr`) and GHCR (`ghcr.io/nicholas-fedor/shoutrrr`). Tags include `latest` (stable production), versioned tags (e.g., `v0.8.0`), and `nightly` (rolling release).
6
7 ## Usage
8
9 === "Docker Hub"
10
11 ```bash title="Pull Command Syntax"
12 docker pull nickfedor/shoutrrr:latest
13 ```
14
15 === "GHCR"
16
17 ```bash title="Pull Command Syntax"
18 docker pull ghcr.io/nicholas-fedor/shoutrrr:latest
19 ```
20
21 Run Shoutrrr CLI commands inside the container using `docker run`.
22
23 The entrypoint is `/shoutrrr`, so commands like `send`, `generate`, `verify` work directly.
24
25 | Tag Examples | Description |
26 |----------------|-------------------------------------------|
27 | `latest` | Latest stable release. |
28 | `vX.Y.Z` | Specific version (e.g., `v0.8.0`). |
29 | `nightly` | Latest rolling release. |
30 | `amd64-latest` | Platform-specific (e.g., amd64, arm64v8). |
31
32 !!! Note
33 The image includes CA certificates and timezone data. No volumes are required by default, but mount if needed for custom configs or stdin input. Environment variables can override flags (e.g., `SHOUTRRR_URL` for `--url`).
34
35 ### Environment Variables
36
37 - Use uppercase flag names prefixed with `SHOUTRRR_` (e.g., `SHOUTRRR_MESSAGE` for `--message`).
38
39 ## Examples
40
41 <!-- markdownlint-disable -->
42 ### Send a Notification
43
44 !!! Example
45 ```bash title="Send to Discord"
46 docker run --rm nickfedor/shoutrrr:latest send --url "discord://abc123@123456789" --message "Hello, Docker!"
47 ```
48
49 ```text title="Expected Output"
50 Notification sent
51 ```
52
53 ### Generate a Service URL
54
55 !!! Example
56 ```bash title="Generate Discord URL"
57 docker run --rm -it nickfedor/shoutrrr:latest generate discord
58 ```
59
60 ```text title="Expected Prompt Inputs"
61 Generating URL for discord using basic generator
62
63 Token: abc123
64 WebhookID: 123456789
65 ```
66
67 ```text title="Expected Output"
68 URL: discord://abc123@123456789
69 ```
70
71 ### Verify a URL with Verbose Output
72
73 !!! Example
74 ```bash title="Verify Slack URL"
75 docker run --rm nickfedor/shoutrrr:latest verify --url "slack://token-a/token-b/token-c"
76 ```
77
78 ```text title="Expected Output"
79 URL valid
80 ```
81
82 ### Send from Stdin with Environment Variables
83
84 !!! Example
85 ```bash title="Send with Env Vars and Stdin"
86 echo "Message from stdin" | docker run --rm -i -e SHOUTRRR_URL="slack://token-a/token-b/token-c" -e SHOUTRRR_MESSAGE="-" nickfedor/shoutrrr:latest send
87 ```
88
89 ```text title="Expected Output"
90 Reading from STDIN...
91 Read 20 byte(s)
92 Notification sent
93 ```
94
95 ### Multi-Architecture Pull and Run
96
97 !!! Example
98 ```bash title="Pull and Run on ARM64"
99 docker pull nickfedor/shoutrrr:arm64v8-latest
100 docker run --rm nickfedor/shoutrrr:arm64v8-latest --version
101 ```
102
103 ```text title="Expected Output"
104 shoutrrr version latest
105 ```
106 <!-- markdownlint-restore -->
107
108 ## Notes
109
110 - **Multi-Architecture**: Use platform-specific tags (e.g., `arm64v8-latest`) or let Docker select automatically with `latest`.
111 - **Timeouts**: Inherits Shoutrrr's 10-second send timeout.
112 - **Volumes**: Mount `/etc/ssl/certs` if custom CA certs are needed, or `/input` for file-based messages.
113 - **Updates**: Pull latest images regularly. For production, pin to versioned tags.
114 - **Debugging**: Add `-v` for verbose output in commands.