itzg / itzg/docker-minecraft-bedrock-server

Multiple instances

Open
#110 15 comments 0 reactions 0 assignees View on GitHub
Dominant language
Shell
Stars
1.9k
Forks
302
Avg merge
2h 26m
Merged PRs (30d)
2

Description

I've been trying, somewhat desperately, to get multiple instances of your excellent container running for my kids on a single machine. I've tried so many things... different ports, macvlan, multiple nics, but no luck for one reason or another.

Any chance you have any ideas why this isn't working?

```
version: "3.7"
services:
minecraft-survival:
image: itzg/minecraft-bedrock-server
container_name: minecraft-survival
environment:
- UID=1000
- GID=1000
- EULA=TRUE
- SERVER_NAME=Survival
- GAMEMODE=survival
- DIFFICULTY=easy
- LEVEL_TYPE=default
- ONLINE_MODE=false
- ALLOW_CHEATS=true
- LEVEL_SEED=1935762385
- SERVER_PORT=19132
- SERVER_PORT_V6=19133
volumes:
- /var/lib/minecraft-survival:/data
ports:
- '19132:19132/udp'
restart: always
stdin_open: true
tty: true

minecraft-creative:
image: itzg/minecraft-bedrock-server
container_name: minecraft-creative
environment:
- UID=1000
- GID=1000
- EULA=TRUE
- SERVER_NAME=Creative
- GAMEMODE=creative
- DIFFICULTY=peaceful
- LEVEL_TYPE=flat
- ONLINE_MODE=false
- ALLOW_CHEATS=true
- SERVER_PORT=19134
- SERVER_PORT_V6=19135
volumes:
- /var/lib/minecraft-creative:/data
ports:
- '19134:19134/udp'
restart: always
stdin_open: true
tty: true
```

The servers start successfully:

```
Starting Bedrock server...
NO LOG FILE! - setting up server logging...
[2020-11-26 13:44:17 INFO] Starting Server
[2020-11-26 13:44:17 INFO] Version 1.16.101.1
[2020-11-26 13:44:17 INFO] Session ID d03d0207-ffb0-4617-adad-733dc1036219
[2020-11-26 13:44:17 INFO] Level Name: Bedrock level
[2020-11-26 13:44:17 INFO] Game mode: 0 Survival
[2020-11-26 13:44:17 INFO] Difficulty: 1 EASY
[INFO] opening worlds/Bedrock level/db
[INFO] IPv4 supported, port: 19132
[INFO] IPv6 not supported
[INFO] IPv4 supported, port: 59031
[INFO] IPv6 not supported
[INFO] Server started.
```

```
Starting Bedrock server...
NO LOG FILE! - setting up server logging...
[2020-11-26 13:44:17 INFO] Starting Server
[2020-11-26 13:44:17 INFO] Version 1.16.101.1
[2020-11-26 13:44:17 INFO] Session ID cc78b276-442f-4c94-b61f-a9bb81a8b947
[2020-11-26 13:44:17 INFO] Level Name: Bedrock level
[2020-11-26 13:44:17 INFO] Game mode: 1 Creative
[2020-11-26 13:44:17 INFO] Difficulty: 0 PEACEFUL
[INFO] opening worlds/Bedrock level/db
[INFO] IPv4 supported, port: 19134
[INFO] IPv6 not supported
[INFO] IPv4 supported, port: 19132
[INFO] IPv6 not supported
[INFO] Server started.
```

But for some reason the server always logs "IPv4 supported" twice, with different ports... the second one appears to be random. However, running "docker ps" gives me this:

```
5 minutes ago Up 5 minutes (healthy) 0.0.0.0:19132->19132/udp minecraft-survival
5 minutes ago Up 5 minutes (healthy) 19132/udp, 0.0.0.0:19134->19134/udp minecraft-creative
```

The fact that 'minecraft-creative' mentions port 19132 in its mappings seems wrong... any idea why that is happening?

Thanks!

Contributor guide

Open the contributing guide

Research direction

Start with the two Docker Compose service definitions, their port declarations, and the startup logs shown in the issue. Reproduce the deployment and compare the resulting `docker ps` mappings with the configured ports; done means explaining the unexpected 19132 mapping and documenting a working multi-instance configuration or the required project change.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker
Domain
devops, infrastructure
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.