You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+19-4Lines changed: 19 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -172,7 +172,11 @@ In this example, the service defined in the `backup-service` directory will only
172
172
173
173
### Step 6: Using Variables (Optional)
174
174
175
-
Dispenser supports using variables in your configuration file via `dispenser.vars`. This file allows you to define values that can be reused inside `dispenser.toml` using `{{ VARIABLE }}` syntax.
175
+
Dispenser supports using variables in your configuration file via `dispenser.vars`. This file allows you to define values that can be reused inside `dispenser.toml` using `${VARIABLE}` syntax.
176
+
177
+
**Note:** While Dispenser uses the `${}` syntax similar to Docker Compose, it does not support all [Docker Compose interpolation features](https://docs.docker.com/compose/how-tos/environment-variables/variable-interpolation/) (such as default values `:-` or error messages `:?`) within `dispenser.toml`.
178
+
179
+
However, variables defined in`dispenser.vars` are passed as environment variables to the underlying `docker compose` commands. This allows you to use them in your `docker-compose.yaml` files, where full Docker Compose interpolation is supported.
176
180
177
181
This is useful forreusing the same configurationin multiple deployments.
178
182
@@ -194,7 +198,18 @@ This is useful for reusing the same configuration in multiple deployments.
194
198
```toml
195
199
[[instance]]
196
200
path = "my-app"
197
-
images = [{ registry ="{{ registry_url }}", name ="my-org/my-app", tag ="{{ app_version }}" }]
201
+
images = [{ registry ="${registry_url}", name ="my-org/my-app", tag ="${app_version}" }]
202
+
```
203
+
204
+
4. Use these variables in your `docker-compose.yaml`.
205
+
206
+
```yaml
207
+
services:
208
+
my-app:
209
+
# You can use the variables defined in dispenser.vars here
0 commit comments