Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor tweaks #4

Open
wants to merge 44 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
e29aa7c
Update to 1.11.4.2
glemsom Jun 26, 2019
9621518
Update Dockerfile
glemsom Jun 26, 2019
50e270c
Update Dockerfile
glemsom Jun 26, 2019
32be8f1
Update README.md
glemsom Jun 26, 2019
2a4cac8
Update to only use one volume
glemsom Jul 5, 2019
9c0cd7a
Add run wrapper
glemsom Jul 5, 2019
f46f8bc
Reflect new changes
glemsom Jul 5, 2019
27f8793
Minor correction
glemsom Jul 5, 2019
b9e33a8
Fix typo
glemsom Jul 5, 2019
559b705
Merge branch 'master' of https://github.com/glemsom/bedrock-server
glemsom Jul 5, 2019
d3fe4c7
Fix filepath
glemsom Jul 5, 2019
17fbd86
Upgrade to 1.12.0.28
Jul 12, 2019
fcac6ce
Use version variable
glemsom Aug 5, 2019
dbce9a1
Remove apt-get cache
glemsom Aug 11, 2019
ffc0394
Update to 1.12.1.1
glemsom Sep 6, 2019
768ecb3
Update to 1.13.0.34
glemsom Nov 3, 2019
b1f5334
Upgrade to 1.13.2.0
glemsom Nov 16, 2019
d194d1c
Upgrade to 1.13.3.0
glemsom Nov 20, 2019
e68ab92
Also expose 19133
glemsom Nov 22, 2019
587c163
Update to 1.14.0.9
glemsom Dec 13, 2019
d4afa77
Update to 1.14.1.4
glemsom Dec 18, 2019
a1cbfb0
Update to 1.14.20.1
glemsom Jan 29, 2020
499ec06
1.14.21.0
glemsom Feb 4, 2020
c3ded32
1.14.30.2
glemsom Feb 11, 2020
11b7149
Only listen on ipv4 socket, and add timezone configuration
glemsom Feb 12, 2020
febb426
Rename TIMEZONE->TZ variable
glemsom Feb 12, 2020
4ad6277
Remove sudo
glemsom Feb 12, 2020
c767922
Remove old libssl
glemsom Feb 12, 2020
1c5f3aa
Just synlink timezone instead
glemsom Feb 12, 2020
bd1aafc
Add tzdata
glemsom Feb 12, 2020
dde2d50
Update to 1.14.32.1
glemsom Mar 5, 2020
14be77a
Update to 1.14.60.5
glemsom Apr 16, 2020
b26b4fa
Update to 1.16.0.2
glemsom Jun 25, 2020
f240ded
Update to 1.16.1.02
glemsom Jul 1, 2020
18ef952
Fix use of correct volume
glemsom Aug 4, 2020
a054a80
Upgrade to 1.16.20.03
glemsom Aug 11, 2020
f1775f7
Upgrade to 1.16.40.02
glemsom Sep 7, 2020
f77854b
Update to 1.16.100.04
glemsom Nov 21, 2020
67bd845
Update to 1.16.201.02
glemsom Jan 13, 2021
2ba004b
Update Dockerfile
glemsom Mar 4, 2021
3a7852a
Upgrade to 1.16.221.01
glemsom May 31, 2021
4b0f4cb
Update Dockerfile
glemsom May 31, 2021
396cac4
Update Dockerfile
glemsom May 31, 2021
aa16b61
Update Dockerfile
glemsom May 31, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 27 additions & 14 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,25 +1,38 @@
FROM ubuntu:latest
FROM ubuntu:18.04

# Set Minecraft bedrock versuin
ENV VERSION=1.16.221.01
ENV TZ=Europe/Copenhagen

# Set timezone
RUN echo ${TZ} > /etc/timezone
RUN ln -snf /usr/share/zoneinfo/${TZ} /etc/localtime

# Install dependencies, download and extract the bedrock server
RUN apt-get update && \
apt-get install -y unzip curl libcurl4 libssl1.0.0 && \
curl https://minecraft.azureedge.net/bin-linux/bedrock-server-1.11.2.1.zip --output bedrock-server.zip && \
apt-get install -y unzip curl libcurl4 tzdata && \
rm -rf /var/lib/apt/lists/* && \
curl https://minecraft.azureedge.net/bin-linux/bedrock-server-${VERSION}.zip --output bedrock-server.zip && \
unzip bedrock-server.zip -d bedrock-server && \
rm bedrock-server.zip

# Create a separate folder for configurations move the original files there and create links for the files
RUN mkdir /bedrock-server/config && \
mv /bedrock-server/server.properties /bedrock-server/config && \
mv /bedrock-server/permissions.json /bedrock-server/config && \
mv /bedrock-server/whitelist.json /bedrock-server/config && \
ln -s /bedrock-server/config/server.properties /bedrock-server/server.properties && \
ln -s /bedrock-server/config/permissions.json /bedrock-server/permissions.json && \
ln -s /bedrock-server/config/whitelist.json /bedrock-server/whitelist.json
VOLUME /bedrock-server/data

EXPOSE 19132/udp
# Delete default config (supplied from volume)
run rm -f /bedrock-server/server.properties /bedrock-server/permissions.json /bedrock-server/whitelist.json

# Setup symlinks from volume
RUN ln -s /bedrock-server/data/worlds /bedrock-server/worlds && \
ln -s /bedrock-server/data/server.properties /bedrock-server/server.properties && \
ln -s /bedrock-server/data/permissions.json /bedrock-server/permissions.json && \
ln -s /bedrock-server/data/whitelist.json /bedrock-server/whitelist.json

VOLUME /bedrock-server/worlds /bedrock-server/config
ADD run.sh /bedrock-server/run.sh

RUN chmod +x /bedrock-server/bedrock_server

EXPOSE 19132/udp

WORKDIR /bedrock-server
ENV LD_LIBRARY_PATH=.
CMD ./bedrock_server
CMD ./run.sh
87 changes: 33 additions & 54 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,66 +1,45 @@
# Minecraft Bedrock Server
Run a bedrock server in a Docker container.

## Introduction
This Docker image will download the Bedrock Server app and set it up, along with its dependencies.
Minecraft Bedrock edition for Docker ( also Synology )

## Usage
### New installation

#### Prerequisites
1. Working docker installation

### For Synology
1. From the Docker application, navigate to Registry, and find "glemsom/bedrock-server" image (earch for glemsom)
2. Right-click, and select Download this image
3. Select the desired version from tags (NOTE: Latest is development tag, and might break at random times)
4. Navigate to Image, and Launch an instance of "glemsom/bedrock-server"
5. Choose "Advanced Settings"
6. OPTIONAL: Select "Enable auto-restart"
7. Under the Volume tab, choose "Add Folder" - and find (or create) a folder for storing Bedrock configuration and world files. Mount the folder as `/bedrock-server/data`
8. Under Port Settings, change "Local Port" from "Auto" to 19132
9. OPTIONAL: Console access to Bedrock
Navigate to Docker -> Container -> Details -> Terminal


### For regular docker
1. Prepare the persistent volumes:
1. Create a volume for the configuration:<br/>
`docker volume create --name "bedrock-config"`
2. Create a volume for the worlds:<br/>
`docker volume create --name "bedrock-worlds"`
1. Create a volume for the Bedrock:<br/>
`docker volume create --name "bedrock-data"`
2. Create the Docker container:
```bash
docker create --name=minecraft\
-v "bedrock-config:/bedrock-server/config"\
-v "bedrock-worlds:/bedrock-server/worlds"\
-p 19132:19132/udp\
--restart=unless-stopped\
roemer/bedrock-server
docker create --name=minecraft \
-v "bedrock-data:/bedrock-server/data" \
-p 19132:19132/udp \
--restart=unless-stopped \
glemsom/bedrock-server:latest
```
3. Configure the default files in the `config` volume:
1. Configure the `server.properties` to your likings.
2. Configure the `whitelist.json` in case you have set `white-list=true` in the above step. Note: The `xuid` is optional and will automatically be added as soon as a matching player connects. Here's an example of a `whitelist.json` file:
```json
[
{
"ignoresPlayerLimit": false,
"name": "MyPlayer"
},
{
"ignoresPlayerLimit": false,
"name": "AnotherPlayer",
"xuid": "274817248"
}
]
```
3. Configure the `permissions.json` and add the operators. This file consists of a list of `permissions` and `xuid`s. The `permissions` can be `member`, `visitor` or `operator`. The `xuid` can be copied from the `whitelist.json` as soon as the user connected once. An example could look like:
```json
[
{
"permission": "operator",
"xuid": "274817248"
}
]
```
3. Start the server:<br/>
`docker start minecraft`

### Updating
1. Stop the server<br/>
```
docker attach minecraft
stop
```
2. Re-create the server with the new image and the same settings (either `manually` or with `portainer` or Synologys `clean`).<br/>
NOTE: When updating from 1.7, you need to use the new installation guide and put your `worlds` and `config` files into the newly created volumes or use appropriate volume mappings when creating the container. You also need to rename `ops.json` to `permissions.json`.
3. Start the server
`docker start minecraft`

3. Start the server:
```bash
docker run -v "bedrock-data:/bedrock-server/data" \
-p 19132:19132/udp glemsom/bedrock-server:latest`

## Commands
There are various commands that can be used in the console. To access the console, you need to attach to the container with the following command:
There are various commands that can be used in the console.
To access the console, you need to attach to the container with the following command:
```
docker attach <container-id>
```
Expand Down
96 changes: 96 additions & 0 deletions run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
#!/bin/sh

# Run wrapper for Minecraft Bedrock Edition
# Setup files & folders, if they do not exist

[ ! -d "/bedrock-server/data/worlds" ] && mkdir -p "/bedrock-server/data/worlds"

if [ ! -f "/bedrock-server/data/server.properties" ]; then

cat << 'EOF' > /bedrock-server/data/server.properties
server-name=Minecraft Bedrock (GlemSom)
# Used as the server name
# Allowed values: Any string

gamemode=survival
# Sets the game mode for new players.
# Allowed values: "survival", "creative", or "adventure"

difficulty=easy
# Sets the difficulty of the world.
# Allowed values: "peaceful", "easy", "normal", or "hard"

allow-cheats=false
# If true then cheats like commands can be used.
# Allowed values: "true" or "false"

max-players=5
# The maximum number of players that can play on the server.
# Allowed values: Any positive integer

online-mode=false
# If true then all connected players must be authenticated to Xbox Live.
# Clients connecting to remote (non-LAN) servers will always require Xbox Live authentication regardless of this setting.
# If the server accepts connections from the Internet, then it's highly recommended to enable online-mode.
# Allowed values: "true" or "false"

white-list=false
# If true then all connected players must be listed in the separate whitelist.json file.
# Allowed values: "true" or "false"

server-port=19132
# Which IPv4 port the server should listen to.
# Allowed values: Integers in the range [1, 65535]

server-portv6=19133
# Which IPv6 port the server should listen to.
# Allowed values: Integers in the range [1, 65535]

view-distance=32
# The maximum allowed view distance in number of chunks.
# Allowed values: Any positive integer.

tick-distance=4
# The world will be ticked this many chunks away from any player.
# Allowed values: Integers in the range [4, 12]

player-idle-timeout=30
# After a player has idled for this many minutes they will be kicked. If set to 0 then players can idle indefinitely.
# Allowed values: Any non-negative integer.

max-threads=8
# Maximum number of threads the server will try to use. If set to 0 or removed then it will use as many as possible.
# Allowed values: Any positive integer.

level-name=Bedrock Level
# Allowed values: Any string

level-seed=
# Use to randomize the world
# Allowed values: Any string

default-player-permission-level=operator
# Permission level for new players joining for the first time.
# Allowed values: "visitor", "member", "operator"

texturepack-required=false
# Force clients to use texture packs in the current world
# Allowed values: "true" or "false"
EOF
fi

if [ ! -f "/bedrock-server/data/permissions.json" ]; then

cat << 'EOF' > /bedrock-server/data/permissions.json
[]
EOF
fi

if [ ! -f "/bedrock-server/data/whitelist.json" ]; then

cat << 'EOF' > /bedrock-server/data/whitelist.json
[]
EOF
fi

./bedrock_server