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: docs/commands.md
+23-7
Original file line number
Diff line number
Diff line change
@@ -19,27 +19,43 @@ docker exec mc rcon-cli stop
19
19
20
20
_The `-i` is not needed in this case._
21
21
22
-
If rcon is disabled you can send commands by passing them as arguments to the packaged `mc-send-to-console` script. For example, a player can be op'ed in the container `mc` with:
22
+
## When RCON is disabled
23
+
24
+
If rcon is disabled you can send commands by passing them as arguments to the packaged `mc-send-to-console` script after setting the env var `CREATE_CONSOLE_IN_PIPE` to "true". For example, a player can be op'ed in the container `mc` with:
23
25
24
26
```shell
25
27
docker exec mc mc-send-to-console op player
26
28
||
27
29
+- container name +- Minecraft commands start here
28
30
```
29
31
30
-
In order to attach and interact with the Minecraft server, add `-it` when starting the container, such as
32
+
## Enabling interactive console
33
+
34
+
In order to attach and interact with the Minecraft server make sure to enable TTY and keep stdin open.
35
+
36
+
!!! example
37
+
38
+
With `docker run` use the `-it` arguments:
31
39
40
+
```shell
32
41
docker run -d -it -p 25565:25565 --name mc itzg/minecraft-server
42
+
```
43
+
44
+
or with a compose file:
45
+
46
+
```yaml
47
+
services:
48
+
minecraft:
49
+
stdin_open: true
50
+
tty: true
51
+
```
33
52
34
53
With that you can attach and interact at any time using
35
54
36
55
docker attach mc
37
56
38
57
and then Control-p Control-q to **detach**.
39
58
40
-
For remote access, configure your Docker daemon to use a `tcp` socket (such as `-H tcp://0.0.0.0:2375`)
41
-
and attach from another machine:
42
-
43
-
docker -H $HOST:2375 attach mc
59
+
!!! info "RCON is required for fully interactive, color console"
44
60
45
-
Unless you're on a home/private LAN, you should [enable TLS access](https://docs.docker.com/articles/https/).
61
+
RCON must be enabled, which is the default, in order to use a fully interactive console with auto-completion and colorized log output.
0 commit comments