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

Docker desktop for Mac, had to forward both TCP and UDP 19132 to container

Open braucktoon opened this issue 5 years ago • 16 comments

I am running Docker desktop on macOS. In order to connect (on my LAN) to the bedrock server from my iPhone on port 19132 I had to forward both UDP and TCP. Is this normal?

docker run -d --name=mc -e GAMEMODE=creative -e DIFFICULTY=peaceful -e EULA=TRUE -p 19132:19132/udp -p 19132:19132 -v /Users/davidmcgough/mc:/data itzg/minecraft-bedrock-server

if I exclude either -p argument I cannot connect. I am raising this issue because I don't see any mention of forwarding the TCP port in the directions.

Thanks.

braucktoon avatar Feb 09 '20 17:02 braucktoon

I thought it should only be necessary to map the UDP port since that is what has worked for me; however, it sounds like mapping both definitely improved your setup. I’ll have to keep this in mind as a possible solution.

So far the UDP only mapping has worked both with Docker Desktop on Windows and regular Docker on Ubuntu. I’ll have to give it a try on Mac to see if that’s the difference.

itzg avatar Feb 11 '20 02:02 itzg

also had to do this

dossjjx avatar Feb 22 '20 02:02 dossjjx

I finally remembered to try this on my Mac and I see what you mean. What's really strange is that I ran two tcpdump's

  • sudo tcpdump -v udp port 19132
  • sudo tcpdump tcp port 19132

There no activity in the tcp one, lots of expected activity in the udp one, but both port bindings were needed to see the server in the iPhone client.

I'm wondering if there's a bug in the Docker Desktop network proxy on MacOS; however, the info from lsof -i:19132 looked ok.

I'll update the README with a note on this behavior or a PR is appreciated.

itzg avatar Feb 27 '20 20:02 itzg

im trying to debug a fresh install, and running tcpdump inside the container—that's what you suggest above, right? just checking because sudo isnt installed on your image (nor is tcpdump but that was easily fixed)

anthonymobile avatar Apr 20 '20 03:04 anthonymobile

I was running those commands on my Mac rather than within the container. I was confirming that even though declaring both types of port bindings seem to help, the TCP one isn’t actually used, as I’d expect.

itzg avatar Apr 20 '20 12:04 itzg

I’m running this on Mac too, created a customised docker-compose, with a trick borrowed from another repo. works well! You can find in my fork.

MattrCoUk avatar Jul 13 '20 15:07 MattrCoUk

@MattrCoUk Can you provide a link to that?

itzg avatar Jul 13 '20 15:07 itzg

here you are: https://github.com/MattrCoUk/docker-minecraft-bedrock-server/blob/master/examples/docker-compose.yml

MattrCoUk avatar Jul 13 '20 16:07 MattrCoUk

Oh...they're not as random as they looked. It would be great if you could PR that example change back to this repo.

itzg avatar Jul 13 '20 16:07 itzg

sure... how do I do that? :-)

MattrCoUk avatar Jul 13 '20 16:07 MattrCoUk

do I need to clone the orig repo update and pull rq?

MattrCoUk avatar Jul 13 '20 16:07 MattrCoUk

ok, just found that, will do shortly

MattrCoUk avatar Jul 13 '20 16:07 MattrCoUk

dunno how to do it. the PR failed due to test fail.

MattrCoUk avatar Jul 13 '20 16:07 MattrCoUk

I believe Minecraft uses TCP in order to display the server list. I'm having a similar issue, but noticed that if I enter the address and port number manually into the servers tab, I was able to connect. I think this is just an issue with the server list.

kyleplo avatar Apr 30 '21 21:04 kyleplo

Trying to get the MC server working on another Mac and run into networking issues again...

Strangely I was able to connect and get on my new MC server world twice by some weird chance, but it prooves not to be repeatable thing...

Tried with macos firewall on/off, even added ports to macos config file. Added the TCP 19123 to docker compose... still no luck.

Any suggestions on how to troubleshoot would be most appreciated...

-- For the reference I have included a fragment of my docker-compose with the trick with limiting of the random second port range. It was working fine for few years on another Mac. image

MattrCoUk avatar Nov 20 '22 12:11 MattrCoUk

Troubleshoot with Wireshark and report an issue with your findings to Mojang.

itzg avatar Nov 20 '22 14:11 itzg