Minecraft docker-container refuses connection So I have this Dockerfile:
FROM openjdk:8u212-jre-alpine

LABEL maintainer &quot;cowboy_patrick&quot;

RUN apk add --no-cache -U \
  openssl \
  imagemagick \
  lsof \
  su-exec \
  shadow \
  bash \
  curl iputils wget \
  git \
  jq \
  python \
  tzdata \
  rsync \
  nano \
  sudo \
  knock \
  ttf-dejavu
  
EXPOSE 25565 25565

COPY minecraft /root/minecraft
WORKDIR /root/minecraft


RUN chmod +x /root/minecraft/start_minecraft.sh

CMD /root/minecraft/start_minecraft.sh

This just copies an existing world into an alpine with java and executes some prewritten scripts, I had written for running it on a vps (doing automatic backups etc.)
When I execute it with

docker run --network host -p 25565:25565 --name mcs mcserver

I can see the following in the container-dashboard:

For good measures you can see my console-output here but it's pretty standard. Just a minecraft-server that boots up.
The only thing I don't understand is why the connection gets refused when I try to join localhost:25565:

Does anyone have an idea on how I can allow this connection? And in extent allow connections from outside my machine (assuming that port-formwarding and everything works).
I’m glad my comment helped. I read the article OP mentioned in his answer and reread his question and I think the issue isn’t using -p instead of —publish as the two work the same, but specifying --network host. In Linux’s version of Docker daemon this prevents port publishing from working and since both Docker for Windows and Docker Toolbox use some sort of virtualization to run that version of Docker for Linux containers, I can only assume it has the same effect. The difference being that host in question is not Windows, but whatever Linux is running on top, so the container is completely unreachable.