Map NetherNet properties and fix healthcheck (#675)

* Map NetherNet properties and add a TCP-aware healthcheck.

TRANSPORT/SERVER_UDP_PORTS/SERVER_IP were ignored; latest BDS also fails the RakNet healthcheck. Leave TRANSPORT unset so pinned RakNet versions keep zip defaults.

* Drop the README hedge about client verification of SERVER_UDP_PORTS.
This commit is contained in:
Jonathan Mendez authored and GitHub committed 2026-09-17 07:40:43 -05:00
1 parent 43e5ef3607
commit 71fbc302b4
5 files changed
+57 -1

No files matched your search

+2 -1
View File
@@ -11,6 +11,7 @@ RUN --mount=target=/build,source=build /build/install-packages
ARG BOX64_PACKAGE=box64 ARG BOX64_PACKAGE=box64
RUN --mount=target=/build,source=build BOX64_PACKAGE=$BOX64_PACKAGE /build/setup-arm64 RUN --mount=target=/build,source=build BOX64_PACKAGE=$BOX64_PACKAGE /build/setup-arm64
EXPOSE 19132/tcp
EXPOSE 19132/udp EXPOSE 19132/udp
EXPOSE 19133/udp EXPOSE 19133/udp
@@ -74,7 +75,7 @@ ENV VERSION=LATEST \
SERVER_PORT_V6=19133 \ SERVER_PORT_V6=19133 \
ENABLE_BDS_V6BIND_FIX=false ENABLE_BDS_V6BIND_FIX=false
HEALTHCHECK --start-period=1m CMD /usr/local/bin/mc-monitor status-bedrock --host 127.0.0.1 --port $SERVER_PORT HEALTHCHECK --start-period=1m CMD /usr/local/bin/bds-healthcheck
ARG BUILDTIME=local ARG BUILDTIME=local
ARG VERSION=local ARG VERSION=local
+16
View File
@@ -19,6 +19,8 @@ If your network is dual-stack (IPv4 and IPv6), also map the IPv6 port: `-p 19132
Alternatively, enable `ENABLE_BDS_V6BIND_FIX=true` to serve both from the same port number - see [IPv6 same-port fix](#ipv6-same-port-fix). Alternatively, enable `ENABLE_BDS_V6BIND_FIX=true` to serve both from the same port number - see [IPv6 same-port fix](#ipv6-same-port-fix).
For `TRANSPORT=nethernet`, see [NetherNet](#nethernet).
## Upgrading to the latest Bedrock server version ## Upgrading to the latest Bedrock server version
With the `VERSION` variable set to "LATEST", which is the default, then the Bedrock server can be upgraded by restarting the container. At every startup, the container checks for the latest version and upgrades, if needed. With the `VERSION` variable set to "LATEST", which is the default, then the Bedrock server can be upgraded by restarting the container. At every startup, the container checks for the latest version and upgrades, if needed.
@@ -94,6 +96,9 @@ Typically, each property is configured instead by the UPPER_SNAKE_CASE equivalen
- `ALLOW_LIST` - `ALLOW_LIST`
- `SERVER_PORT` - `SERVER_PORT`
- `SERVER_PORT_V6` - `SERVER_PORT_V6`
- `SERVER_IP`
- `SERVER_UDP_PORTS`
- `TRANSPORT`
- `ENABLE_LAN_VISIBILITY` - `ENABLE_LAN_VISIBILITY`
- `VIEW_DISTANCE` - `VIEW_DISTANCE`
- `TICK_DISTANCE` - `TICK_DISTANCE`
@@ -157,9 +162,18 @@ docker run -d -it --name bds-flat-creative \
- **UDP** 19132 : the Bedrock server port for IPv4 clients, set by `SERVER_PORT` - **UDP** 19132 : the Bedrock server port for IPv4 clients, set by `SERVER_PORT`
- **UDP** 19133 : the default Bedrock server port for IPv6 clients, set by `SERVER_PORT_V6` - **UDP** 19133 : the default Bedrock server port for IPv6 clients, set by `SERVER_PORT_V6`
- **TCP** 19132 : also `EXPOSE`d; used when `TRANSPORT=nethernet`
> **NOTE**: with `ENABLE_BDS_V6BIND_FIX=true`, both ports can be set to the same value (e.g. 19132), exposing the same port number for both address families - this is recommended for dual-stack environments to avoid connectivity problems. > **NOTE**: with `ENABLE_BDS_V6BIND_FIX=true`, both ports can be set to the same value (e.g. 19132), exposing the same port number for both address families - this is recommended for dual-stack environments to avoid connectivity problems.
## NetherNet
`TRANSPORT`, `SERVER_UDP_PORTS`, and `SERVER_IP` are mapped into `server.properties` the same way as the other keys on this list.
When `TRANSPORT=nethernet`, the image healthcheck is `GET http://127.0.0.1:$SERVER_PORT/v1/join`. Otherwise it still runs `mc-monitor status-bedrock` on `$SERVER_PORT`.
[examples/nethernet/compose.yml](examples/nethernet/compose.yml) sets `TRANSPORT=nethernet` and publishes `19132/tcp` plus UDP `19140-19155`. `SERVER_UDP_PORTS` values are those documented in the BDS `server.properties` comments. LAN discovery (UDP 7551) was not tested.
## IPv6 same-port fix ## IPv6 same-port fix
BDS binds IPv4 and IPv6 on separate ports by default (19132 and 19133). BDS binds IPv4 and IPv6 on separate ports by default (19132 and 19133).
@@ -371,6 +385,8 @@ The [examples](examples) directory contains [an example Docker compose file](exa
- 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 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` - a volume attached to the service at the container path `/data`
For `TRANSPORT=nethernet`, see [examples/nethernet/compose.yml](examples/nethernet/compose.yml).
```yaml ```yaml
services: services:
bds: bds:
+11
View File
@@ -0,0 +1,11 @@
#!/bin/bash
# Only probe NetherNet HTTP when the user asked for it. Otherwise RakNet UDP
# via mc-monitor — including unset TRANSPORT and older VERSION= pins.
SERVER_PORT="${SERVER_PORT:-19132}"
if [[ "${TRANSPORT,,}" == "nethernet" ]]; then
exec curl -fsS -o /dev/null --max-time 5 "http://127.0.0.1:${SERVER_PORT}/v1/join"
fi
exec mc-monitor status-bedrock --host 127.0.0.1 --port "$SERVER_PORT"
+18
View File
@@ -0,0 +1,18 @@
services:
bds:
image: itzg/minecraft-bedrock-server
environment:
EULA: "TRUE"
TRANSPORT: "nethernet"
# Bind-only (network_mode: host, or when BDS already listens on a reachable address):
# SERVER_UDP_PORTS: "19140-19155"
# Advertised mapping behind Docker bridge / extra NAT: <reachable-ip>:external-udp:internal-udp
# (IPv4 or IPv6 literal, not a hostname)
# SERVER_UDP_PORTS: "<reachable-ip>:19140-19155:19140-19155"
ports:
- "19132:19132/tcp"
- "19140-19155:19140-19155/udp"
volumes:
- ./data:/data
stdin_open: true
tty: true
+10
View File
@@ -51,6 +51,16 @@
"server-portv6": { "server-portv6": {
"env": "SERVER_PORT_V6" "env": "SERVER_PORT_V6"
}, },
"server-ip": {
"env": "SERVER_IP"
},
"server-udp-ports": {
"env": "SERVER_UDP_PORTS"
},
"transport": {
"env": "TRANSPORT",
"allowed": ["raknet", "nethernet"]
},
"enable-lan-visibility": { "enable-lan-visibility": {
"env": "ENABLE_LAN_VISIBILITY", "env": "ENABLE_LAN_VISIBILITY",
"allowed": ["true", "false"] "allowed": ["true", "false"]