docs: add compose example of multiline MOTD

This commit is contained in:
Geoff Bourne 2024-05-15 16:07:46 -05:00
parent cbcdfdc288
commit 675232697a
2 changed files with 29 additions and 1 deletions

View File

@ -64,9 +64,25 @@ The section symbol (§) and other unicode characters are automatically converted
![](../img/motd-example.png)
To produce a multi-line MOTD, embed a newline character as `\n` in the string, such as
To produce a multi-line MOTD, embed a newline character as `\n` in the string, such as the following example.
!!! example "Multi-line MOTD"
With `docker run`
```
-e MOTD="Line one\nLine two"
```
or within a compose file
```yaml
MOTD: |
line one
line two
# or
# MOTD: "line one\nline two"
```
!!! tip

View File

@ -0,0 +1,12 @@
services:
mc:
image: itzg/minecraft-server
environment:
EULA: true
MOTD: |
line one
line two
# or
# MOTD: "line one\nline two"
ports:
- "25565:25565"