注意! 请一定不要指定环境变量 VERSION=xxx 缺点是不能灵活切换版本,但是切换版本要下载 国内又下载不了 所以你直接指定docker images的tag就行了
PS: 如果懒得折腾可以来我的服务器 mc.ptrace.cn:19132 交流qq群: 1140238048
version: '3.8'
services:
bds:
image: luodaoyi/minecraft-bedrock-server
environment:
EULA: "TRUE"
GAMEMODE: survival
DIFFICULTY: easy
SERVER_NAME: 'Evolution World'
SERVER_PORT: 19132
MAX_PLAYERS: 100
MAX_THREADS: 8
ALLOW_CHEATS: "FALSE"
LEVEL_NAME: '20200714'
ports:
- 19132:19132/udp
volumes:
- bds:/data
restart: always
stdin_open: true
tty: true
volumes:
bds:
The following starts a Bedrock Dedicated Server running a default version and exposing the default UDP port:
docker run -d -it -e EULA=TRUE -p 19132:19132/udp itzg/minecraft-bedrock-server
For Minecraft Java Edition you'll need to use this image instead:
EULA (no default) : must be set to TRUE to
accept the Minecraft End User License AgreementVERSION (LATEST) : can be set to a specific server version or the following special values can be used:
LATEST : determines the latest version and can be used to auto-upgrade on container startPREVIOUS : uses the previously maintained major version. Useful when the mobile app is gradually being upgraded across devices1.11 : the latest version of 1.111.12 : the latest version of 1.121.13 : the latest version of 1.131.14 : the latest version of 1.141.16 : the latest version of 1.16UID (default derived from /data owner) : can be set to a specific user ID to run the
bedrock server processGID (default derived from /data owner) : can be set to a specific group ID to run the
bedrock server processThe following environment variables will set the equivalent property in server.properties, where each is described here.
SERVER_NAMESERVER_PORTGAMEMODEDIFFICULTYLEVEL_TYPEALLOW_CHEATSMAX_PLAYERSONLINE_MODEWHITE_LISTVIEW_DISTANCETICK_DISTANCEPLAYER_IDLE_TIMEOUTMAX_THREADSLEVEL_NAMELEVEL_SEEDDEFAULT_PLAYER_PERMISSION_LEVELTEXTUREPACK_REQUIREDFor example, to configure a flat, creative server instead of the default use:
docker run -d -it --name bds-flat-creative \
-e EULA=TRUE -e LEVEL_TYPE=flat -e GAMEMODE=creative \
-p 19132:19132/udp itzg/minecraft-bedrock-server
/udp when exposing the port, such as -p 19132:19132/udp/data : the location where the downloaded server is expanded and ran. Also contains the
configuration properties file server.propertiesYou can create a named volume and use it as:
docker volume create mc-volume
docker run -d -it --name mc-server -e EULA=TRUE -p 19132:19132/udp -v mc-volume:/data itzg/minecraft-bedrock-server
When running the container on your LAN, you can find and connect to the dedicated server in the "LAN Games" part of the "Friends" tab, such as:

For more information about managing Bedrock Dedicated Servers in general, check out this Reddit post.
Assuming you started container with stdin and tty enabled (such as using -it), you can attach to the container's console by its name or ID using:
docker attach CONTAINER_NAME_OR_ID
While attached, you can execute any server-side commands, such as op'ing your player to be admin:
op YOUR_XBOX_USERNAME
When finished, detach from the server console using Ctrl-p, Ctrl-q
The examples directory contains an example Docker compose file that declares:
The service configuration includes some examples of configuring the server properties via environment variables:
environment:
EULA: "TRUE"
GAMEMODE: survival
DIFFICULTY: normal
From with in the examples directory, you can deploy the composition by using:
docker-compose up -d
You can follow the logs using:
docker-compose logs -f bds
The examples directory contains an example Kubernetes manifest file that declares:
The pod deployment includes some examples of configuring the server properties via environment variables:
env:
- name: EULA
value: "TRUE"
- name: GAMEMODE
value: survival
- name: DIFFICULTY
value: normal
The file is deploy-able as-is on most clusters, but has been confirmed on Docker for Desktop and Google Kubernetes Engine:
kubectl apply -f examples/kubernetes.yml
You can follow the logs of the deployment using:
kubectl logs -f deployment/bds
Content type
Image
Digest
Size
134.1 MB
Last updated
about 6 years ago
docker pull luodaoyi/minecraft-bedrock-server