diff --git a/Dockerfile b/Dockerfile index 90c927b..29b8687 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,6 +12,7 @@ ARG BOX64_PACKAGE=box64 RUN --mount=target=/build,source=build BOX64_PACKAGE=$BOX64_PACKAGE /build/setup-arm64 EXPOSE 19132/udp +EXPOSE 19133/udp VOLUME ["/data"] @@ -58,7 +59,8 @@ COPY bin/* /usr/local/bin/ # https://minecraft.wiki/w/Bedrock_Edition_1.13.0 # https://minecraft.wiki/w/Bedrock_Edition_1.14.0 ENV VERSION=LATEST \ - SERVER_PORT=19132 + SERVER_PORT=19132 \ + SERVER_PORT_V6=19133 HEALTHCHECK --start-period=1m CMD /usr/local/bin/mc-monitor status-bedrock --host 127.0.0.1 --port $SERVER_PORT diff --git a/README.md b/README.md index 91075f6..0bcba2f 100644 --- a/README.md +++ b/README.md @@ -7,12 +7,18 @@ ## Quickstart The following starts a Bedrock Dedicated Server running a default version and -exposing the default UDP port: +exposing the default IPv4 UDP port: ```bash docker run -d -it -e EULA=TRUE -p 19132:19132/udp -v mc-bedrock-data:/data itzg/minecraft-bedrock-server ``` +If your network is dual-stack (IPv4 and IPv6), also map the IPv6 port: + +```bash +-p 19132:19132/udp -p 19133:19133/udp +``` + > **NOTE**: if you plan on running a server for a longer amount of time it is highly recommended using a management layer such as [Docker Compose](#deploying-with-docker-compose) or [Kubernetes](#deploying-with-kubernetes) to allow for incremental reconfiguration and image upgrades. ## Upgrading to the latest Bedrock server version @@ -148,8 +154,10 @@ docker run -d -it --name bds-flat-creative \ ## Exposed Ports -- **UDP** 19132 : the Bedrock server port on IPv4 set by `SERVER_PORT`. The IPv6 port is not exposed by default. - **NOTE** that you must append `/udp` when exposing the port, such as `-p 19132:19132/udp` and both IPv4 and IPv6 must be enabled on your host machine. +- **UDP** 19132 : the Bedrock server port for IPv4 clients, set by `SERVER_PORT` +- **UDP** 19133 : the Bedrock server port for IPv6 clients, set by `SERVER_PORT_V6` + +**NOTE** that you must append `/udp` when exposing the ports, such as `-p 19132:19132/udp -p 19133:19133/udp`. ## Volumes @@ -335,7 +343,7 @@ When finished, detach from the server console using Ctrl-p, Ctrl-q ## Deploying with Docker Compose The [examples](examples) directory contains [an example Docker compose file](examples/docker-compose.yml) that declares: -- a service running the bedrock server container and exposing UDP port 19132. In the example is named "bds", short for "Bedrock Dedicated Server", but you can name the service whatever you want +- a service running the bedrock server container and exposing UDP ports 19132 (IPv4) and 19133 (IPv6). In the example is named "bds", short for "Bedrock Dedicated Server", but you can name the service whatever you want - a volume attached to the service at the container path `/data` ```yaml @@ -346,6 +354,7 @@ services: EULA: "TRUE" ports: - "19132:19132/udp" + - "19133:19133/udp" volumes: - ./data:/data stdin_open: true diff --git a/examples/AzureBedrockServer.ps1 b/examples/AzureBedrockServer.ps1 index 9f339e5..90c0754 100644 --- a/examples/AzureBedrockServer.ps1 +++ b/examples/AzureBedrockServer.ps1 @@ -20,7 +20,7 @@ $STORAGE_KEY=$(az storage account keys list --resource-group mineResGroup --acco echo $STORAGE_KEY #to actually create the minecraft server int the dns name "minesvrbedrock" -#the server will be running into server "minesvrbedrock.southcentralus.azurecontainer.io" port "19132", this take some time be patient. +#the server will be running into server "minesvrbedrock.southcentralus.azurecontainer.io" ports "19132" (IPv4) and "19133" (IPv6), this take some time be patient. az container create --resource-group mineResGroup --name minecotainer --image itzg/minecraft-bedrock-server --dns-name-label minesvrbedrock --ports 19132 19133 --protocol udp --restart-policy OnFailure --environment-variables EULA=TRUE --azure-file-volume-account-name acismineacc --azure-file-volume-account-key $STORAGE_KEY --azure-file-volume-share-name acismineshare --azure-file-volume-mount-path /data #connect to fileshare drive "M" to edit server.properties and everything else diff --git a/examples/docker-compose.yml b/examples/docker-compose.yml index c647b71..f45ae49 100644 --- a/examples/docker-compose.yml +++ b/examples/docker-compose.yml @@ -5,6 +5,7 @@ services: EULA: "TRUE" ports: - "19132:19132/udp" + - "19133:19133/udp" volumes: - ./data:/data stdin_open: true diff --git a/examples/kubernetes-tailscale-operator.yml b/examples/kubernetes-tailscale-operator.yml index 0649172..22a3cd8 100644 --- a/examples/kubernetes-tailscale-operator.yml +++ b/examples/kubernetes-tailscale-operator.yml @@ -82,6 +82,8 @@ spec: ports: - containerPort: 19132 protocol: UDP + - containerPort: 19133 + protocol: UDP readinessProbe: &probe exec: command: @@ -115,3 +117,5 @@ spec: ports: - port: 19132 protocol: UDP + - port: 19133 + protocol: UDP diff --git a/examples/kubernetes.yml b/examples/kubernetes.yml index 4f376ec..eade578 100644 --- a/examples/kubernetes.yml +++ b/examples/kubernetes.yml @@ -17,6 +17,7 @@ data: #LEVEL_SEED: "33480944" #SERVER_NAME: "my_minecraft_server" #SERVER_PORT: "19132" + #SERVER_PORT_V6: "19133" #LEVEL_TYPE: "DEFAULT" # Options: FLAT, LEGACY, DEFAULT #ALLOW_CHEATS: "false" # Options: true, false #MAX_PLAYERS: "10" @@ -63,6 +64,8 @@ spec: ports: - containerPort: 19132 protocol: UDP + - containerPort: 19133 + protocol: UDP readinessProbe: &probe exec: command: @@ -92,10 +95,15 @@ metadata: spec: selector: app: bds + ipFamilyPolicy: PreferDualStack + ipFamilies: + - IPv4 + - IPv6 ports: - port: 19132 protocol: UDP - ipFamily: IPv4 + - port: 19133 + protocol: UDP # Use LoadBalancer if running on a provider that supports that # type: LoadBalancer # or use NodePort on a non-managed system;