Skip to content

Commit 09b8859

Browse files
authored
Expose and document IPv6 port 19133 by default (#626)
1 parent 86c278f commit 09b8859

6 files changed

Lines changed: 31 additions & 7 deletions

File tree

Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ ARG BOX64_PACKAGE=box64
1212
RUN --mount=target=/build,source=build BOX64_PACKAGE=$BOX64_PACKAGE /build/setup-arm64
1313

1414
EXPOSE 19132/udp
15+
EXPOSE 19133/udp
1516

1617
VOLUME ["/data"]
1718

@@ -58,7 +59,8 @@ COPY bin/* /usr/local/bin/
5859
# https://minecraft.wiki/w/Bedrock_Edition_1.13.0
5960
# https://minecraft.wiki/w/Bedrock_Edition_1.14.0
6061
ENV VERSION=LATEST \
61-
SERVER_PORT=19132
62+
SERVER_PORT=19132 \
63+
SERVER_PORT_V6=19133
6264

6365
HEALTHCHECK --start-period=1m CMD /usr/local/bin/mc-monitor status-bedrock --host 127.0.0.1 --port $SERVER_PORT
6466

README.md

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,18 @@
77
## Quickstart
88

99
The following starts a Bedrock Dedicated Server running a default version and
10-
exposing the default UDP port:
10+
exposing the default IPv4 UDP port:
1111

1212
```bash
1313
docker run -d -it -e EULA=TRUE -p 19132:19132/udp -v mc-bedrock-data:/data itzg/minecraft-bedrock-server
1414
```
1515

16+
If your network is dual-stack (IPv4 and IPv6), also map the IPv6 port:
17+
18+
```bash
19+
-p 19132:19132/udp -p 19133:19133/udp
20+
```
21+
1622
> **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.
1723
1824
## Upgrading to the latest Bedrock server version
@@ -148,8 +154,10 @@ docker run -d -it --name bds-flat-creative \
148154

149155
## Exposed Ports
150156

151-
- **UDP** 19132 : the Bedrock server port on IPv4 set by `SERVER_PORT`. The IPv6 port is not exposed by default.
152-
**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.
157+
- **UDP** 19132 : the Bedrock server port for IPv4 clients, set by `SERVER_PORT`
158+
- **UDP** 19133 : the Bedrock server port for IPv6 clients, set by `SERVER_PORT_V6`
159+
160+
**NOTE** that you must append `/udp` when exposing the ports, such as `-p 19132:19132/udp -p 19133:19133/udp`.
153161

154162
## Volumes
155163

@@ -335,7 +343,7 @@ When finished, detach from the server console using Ctrl-p, Ctrl-q
335343
## Deploying with Docker Compose
336344

337345
The [examples](examples) directory contains [an example Docker compose file](examples/docker-compose.yml) that declares:
338-
- 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
346+
- 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
339347
- a volume attached to the service at the container path `/data`
340348

341349
```yaml
@@ -346,6 +354,7 @@ services:
346354
EULA: "TRUE"
347355
ports:
348356
- "19132:19132/udp"
357+
- "19133:19133/udp"
349358
volumes:
350359
- ./data:/data
351360
stdin_open: true

examples/AzureBedrockServer.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ $STORAGE_KEY=$(az storage account keys list --resource-group mineResGroup --acco
2020
echo $STORAGE_KEY
2121

2222
#to actually create the minecraft server int the dns name "minesvrbedrock"
23-
#the server will be running into server "minesvrbedrock.southcentralus.azurecontainer.io" port "19132", this take some time be patient.
23+
#the server will be running into server "minesvrbedrock.southcentralus.azurecontainer.io" ports "19132" (IPv4) and "19133" (IPv6), this take some time be patient.
2424
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
2525

2626
#connect to fileshare drive "M" to edit server.properties and everything else

examples/docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ services:
55
EULA: "TRUE"
66
ports:
77
- "19132:19132/udp"
8+
- "19133:19133/udp"
89
volumes:
910
- ./data:/data
1011
stdin_open: true

examples/kubernetes-tailscale-operator.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@ spec:
8282
ports:
8383
- containerPort: 19132
8484
protocol: UDP
85+
- containerPort: 19133
86+
protocol: UDP
8587
readinessProbe: &probe
8688
exec:
8789
command:
@@ -115,3 +117,5 @@ spec:
115117
ports:
116118
- port: 19132
117119
protocol: UDP
120+
- port: 19133
121+
protocol: UDP

examples/kubernetes.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ data:
1717
#LEVEL_SEED: "33480944"
1818
#SERVER_NAME: "my_minecraft_server"
1919
#SERVER_PORT: "19132"
20+
#SERVER_PORT_V6: "19133"
2021
#LEVEL_TYPE: "DEFAULT" # Options: FLAT, LEGACY, DEFAULT
2122
#ALLOW_CHEATS: "false" # Options: true, false
2223
#MAX_PLAYERS: "10"
@@ -63,6 +64,8 @@ spec:
6364
ports:
6465
- containerPort: 19132
6566
protocol: UDP
67+
- containerPort: 19133
68+
protocol: UDP
6669
readinessProbe: &probe
6770
exec:
6871
command:
@@ -92,10 +95,15 @@ metadata:
9295
spec:
9396
selector:
9497
app: bds
98+
ipFamilyPolicy: PreferDualStack
99+
ipFamilies:
100+
- IPv4
101+
- IPv6
95102
ports:
96103
- port: 19132
97104
protocol: UDP
98-
ipFamily: IPv4
105+
- port: 19133
106+
protocol: UDP
99107
# Use LoadBalancer if running on a provider that supports that
100108
# type: LoadBalancer
101109
# or use NodePort on a non-managed system;

0 commit comments

Comments
 (0)