├── .github └── workflows │ └── docker.yaml ├── Dockerfile └── README.md /.github/workflows/docker.yaml: -------------------------------------------------------------------------------- 1 | name: Docker Main Build 2 | 3 | on: 4 | workflow_dispatch: 5 | push: 6 | branches: 7 | - main 8 | 9 | jobs: 10 | docker: 11 | runs-on: ubuntu-latest 12 | steps: 13 | - uses: actions/checkout@v2 14 | with: 15 | fetch-depth: 0 16 | 17 | - name: Build 18 | run: | 19 | docker build \ 20 | --tag ghcr.io/nguyer/bedrock-server:latest . 21 | 22 | - name: Push docker image 23 | run: | 24 | echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u $GITHUB_ACTOR --password-stdin 25 | docker push ghcr.io/nguyer/bedrock-server:latest -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:bionic 2 | 3 | RUN apt-get update 4 | RUN apt-get install -y unzip curl libcurl4 libssl1.0.0 5 | RUN curl https://minecraft.azureedge.net/bin-linux/bedrock-server-1.18.33.02.zip --output bedrock-server.zip 6 | RUN unzip bedrock-server.zip -d bedrock-server 7 | RUN chmod +x bedrock-server/bedrock_server 8 | RUN rm bedrock-server.zip 9 | 10 | WORKDIR /bedrock-server 11 | ENV LD_LIBRARY_PATH=. 12 | CMD ./bedrock_server 13 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # minecraft-bedrock 2 | Run a bedrock server in a Docker container 3 | 4 | This Dockerfile will download the Bedrock Server app and set it up, along with its dependencies. 5 | 6 | If you run the container as is, the `worlds` directory will be created inside the container, which is unadvisable. It is highly recommended that you store your worlds outside the container using a mount. It is also likely that you will want to customize your `server.properties` file. The best way to do this is also using a `server.properties` file outside the container using a mount. 7 | 8 | Here is a `docker run` command that will do that, assuming you have a `worlds` directory and `server.properties` file at `/minecraft`. (You should change the path to wherever your stuff is.) 9 | 10 | $ sudo docker run -d --name=minecraft\ 11 | -v '/minecraft/worlds:/bedrock-server/worlds'\ 12 | -v '/minecraft/server.properties:/bedrock-server/server.properties'\ 13 | --network host\ 14 | --restart=always\ 15 | nguyer/bedrock-server 16 | 17 | If you wanted to use custom resource packs, a whitelist, or other things, you could also mount those paths as well. Separating the content from the sever executable means that you can safely destroy your Docker container without losing your world. This will come in handy when there are updates to the server app, and you want to redeploy the container. 18 | 19 | Hopefully this is helpful to folks. Happy Minecrafting! 20 | 21 | -- nguyer 22 | --------------------------------------------------------------------------------