Skip to content

Commit ac7bf43

Browse files
authored
Fixed support for mc-send-to-console (#2652)
1 parent 14de928 commit ac7bf43

File tree

3 files changed

+26
-8
lines changed

3 files changed

+26
-8
lines changed

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
4444
--var version=${MC_MONITOR_VERSION} --var app=mc-monitor --file {{.app}} \
4545
--from ${GITHUB_BASEURL}/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
4646

47-
ARG MC_SERVER_RUNNER_VERSION=1.11.0
47+
ARG MC_SERVER_RUNNER_VERSION=1.11.1
4848
RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
4949
--var version=${MC_SERVER_RUNNER_VERSION} --var app=mc-server-runner --file {{.app}} \
5050
--from ${GITHUB_BASEURL}/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz

docs/commands.md

+23-7
Original file line numberDiff line numberDiff line change
@@ -19,27 +19,43 @@ docker exec mc rcon-cli stop
1919

2020
_The `-i` is not needed in this case._
2121

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:
2325

2426
```shell
2527
docker exec mc mc-send-to-console op player
2628
| |
2729
+- container name +- Minecraft commands start here
2830
```
2931

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:
3139

40+
```shell
3241
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+
```
3352

3453
With that you can attach and interact at any time using
3554

3655
docker attach mc
3756

3857
and then Control-p Control-q to **detach**.
3958

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"
4460

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.

examples/docker-compose.yml

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ version: '3'
44
services:
55
minecraft:
66
image: itzg/minecraft-server
7+
stdin_open: true
8+
tty: true
79
ports:
810
- "25565:25565"
911
volumes:

0 commit comments

Comments
 (0)