Closed davidmoshal closed 2 years ago
SOLVED! The solution was to give the servers different container names, eg:
mc1
and the second mc2
:
services:
mc1:
image: itzg/minecraft-server
services:
mc2:
image: itzg/minecraft-server
I believe a different folder name where the docker-compose file is stored should also help
davidmoshal, could you share how you got 2 Minecraft servers running on the same docker (in separate containers). what settings did you end up using to make it work? I'm still getting a port conflict (port wont bind) when I try to start the second minecraft server
@Marshin386 just change the host (left-side) part of the port mapping to choose unique host ports such as 25566
on mc2
:
version: "3"
services:
mc1:
image: itzg/minecraft-server
ports:
- "25565:25565"
environment:
EULA: "TRUE"
volumes:
- ./mc1-data:/data
mc2:
image: itzg/minecraft-server
ports:
- "25566:25565"
environment:
EULA: "TRUE"
volumes:
- ./mc2-data:/data
Stack from first server
version: "2" services: minecraft-server: image: itzg/minecraft-server:java17 container_name: MC118 network_mode: host environment:
Stack from second server (that won't start because of a port conflict) see attached copy of docker log from second server trying to start
version: "2" services: minecraft-server2: image: itzg/minecraft-server:java17 container_name: minecraft2 network_mode: host environment:
@Marshin386 network_mode: host
-- that's your problem
Thank you, took me a few to realize I just needed to remove the line (not necessary to run)
able to now run more than one at a time now.
This issue is stale because it has been open 30 days with no activity. Please add a comment describing the reason to keep this issue open.
Enhancement Type
Not sure
Describe the enhancement
Not sure if this is already supported. If so, the request is for documentation on how to do it.
So far I've discovered that just running separate containers doesn't work because the second server kills the first server. Even with different:
Server 1 docker-compose.yml:
Server 2 docker-compose.yml
Here is the log from the first server when the second server is started:
So, something in the second server kills the first server.