docker-minecraft-bedrock-server icon indicating copy to clipboard operation
docker-minecraft-bedrock-server copied to clipboard

2 ports ?

Open bitfreak030 opened this issue 3 years ago • 10 comments

What does the second port do? 50707 Port is random after restart.

afbeelding

bitfreak030 avatar Dec 06 '21 16:12 bitfreak030

I have never know why it mentions two or more ports on the logs. 19132 is only one I know needs to be mapped.

itzg avatar Dec 06 '21 17:12 itzg

its works great with the default port. Thank you for your answer.

bitfreak030 avatar Dec 06 '21 18:12 bitfreak030

I seem to be having the same issue tho, even known my docker-compose file seems to be properly set up, after it says server started right after it gives another ipv4 log with a random port.

image image

fukurouchu avatar Feb 06 '22 03:02 fukurouchu

I seem to be having the same issue tho, even known my docker-compose file seems to be properly set up, after it says server started right after it gives another ipv4 log with a random port.

image image

Ok so I thought that it was actually stopping the server from working but it turns out that I just didn't set it up correctly on cloudflare, so it actually works despite it showing 2 ports.

fukurouchu avatar Feb 06 '22 17:02 fukurouchu

This is a known issue with Bedrock Server: https://bugs.mojang.com/browse/BDS-3989. Seeing how long it has been open, it is not likely to get fixed any time soon. This bug is the primary reason I use docker for Bedrock Servers.

When running multiple server containers on a single host, be sure to specify SERVER_PORT and the ports: section with the same port. So if you wanted to run a server on port 23456, your config would look something like:

version: '3.4'
services:
  birthday:
    image: itzg/minecraft-bedrock-server:latest
    environment:
      SERVER_PORT: "23456"
  ...
    ports:
      - 23456:23456/udp

When your server container starts, it will still show two ports: 23456 and 19132. However, since you are only exporting 23456, you can safely ignore the other port.

nomad64 avatar Apr 28 '22 16:04 nomad64

SERVER_PORT: "23456"

I found when setting SERVER_PORT: "19132" only one port shows in the log. This will also render the container Unhealthy - so maybe not a way to go.

Hamsterman avatar Aug 20 '22 13:08 Hamsterman

@Hamsterman thats odd since that's already the default from the image

https://github.com/itzg/docker-minecraft-bedrock-server/blob/8a2f1bfeada27aad8208991ec7de20b23cb376c0/Dockerfile#L46

itzg avatar Aug 20 '22 16:08 itzg

I just tried it again - it's unhealthy

minecraft_bedrock:
    image: itzg/minecraft-bedrock-server
    container_name: minecraft_bedrock
    ports:
        - "19132:19132/udp"
    environment: 
        - EULA=TRUE            
        - SERVER_PORT="19132"
    tty: true
    stdin_open: true
    restart: unless-stopped
    volumes:
        - //myfolder/minecraft-bedrock:/data

Hamsterman avatar Aug 21 '22 10:08 Hamsterman

@Hamsterman with list-style environment don't include the quotes. "19132" is getting literally set in server.properties.

itzg avatar Aug 21 '22 13:08 itzg

@Hamsterman with list-style environment don't include the quotes. "19132" is getting literally set in server.properties.

Ah yes - that was an error.

Hamsterman avatar Aug 21 '22 15:08 Hamsterman