This is just an update to the Minecraft 1.17.1 server. |
2 years ago | |
---|---|---|
.gitea/ISSUE_TEMPLATE | 2 years ago | |
build | 2 years ago | |
docs | 2 years ago | |
files | 2 years ago | |
tests | 2 years ago | |
.editorconfig | 2 years ago | |
.gitattributes | 2 years ago | |
.gitignore | 2 years ago | |
.gitmessage | 2 years ago | |
.hadolint.yml | 2 years ago | |
.minecraft.conf | 2 years ago | |
CHANGELOG.md | 2 years ago | |
Containerfile | 2 years ago | |
KUDOS.txt | 2 years ago | |
LICENSE | 2 years ago | |
README.md | 2 years ago |
README.md
Container: Minecraft
A simple container for vanilla Minecraft servers.
Disclaimer
while-true-do.io is NOT approved or endorsed by Mojang AB or Microsoft Corporation. We are also NOT associated or connected with Mojang AB or Microsoft Corporation.
Motivation
Playing some games is relaxing and Minecraft is something we wanted to play.
Description
This container is a wrapper to download and configure a Minecraft server properly. It can be used for your own game server at home or in a VPS.
Requirements
You need to have Docker or Podman installed.
Usage
Running the container is described in details in this section.
Minecraft Eula
Be aware, that You need to acknowledge the Minecraft EULA. You can read about it here https://www.minecraft.net/download/server/
To acknowledge the EULA, you need to provide --env EULA=true
during the start.
Run container
You can run a simple instance and acknowledge the Eula.
# Podman (automatic port)
$ podman run --detach --tty --publish-all --env EULA=true whiletruedo/minecraft
# Podman (defined port)
$ podman run --detach --tty --publish 25565:25565 --env EULA=true whiletruedo/minecraft
# Docker (defined port)
$ docker run --detach --tty --publish 25565:25565 --env EULA=true whiletruedo/minecraft
You can also specify the version.
# Podman
$ podman run --detach --tty --publish-all --env EULA=true whiletruedo/minecraft:1.16.5
# Docker
$ docker run --detach --tty --publish-all --env EULA=true whiletruedo/minecraft:1.16.5
You can use a volume for persistent storage.
# Podman
$ podman run --detach --tty --publish-all --env EULA=true --volume minecraft:/opt/minecraft/ whiletruedo/minecraft
# Docker
$ docker run --detach --tty --publish-all --env EULA=true --volume minecraft:/opt/minecraft/ whiletruedo/minecraft
You can configure your server with environment variables. Please see below for details about usable variables and default values.
For simple configurations, you can provide the variables inline.
# Podman
$ podman run --detach --tty --publish-all --env EULA=true --env XMS=512M --env XMX=2048M --env PVP=false whiletruedo/minecraft
# Docker
$ docker run --detach --tty --publish-all --env EULA=true --env XMS=512M --env XMX=2048M --env PVP=false whiletruedo/minecraft
Since Mincecraft can be configured with several properties and options you can provide an environment file.
# Podman
$ podman run --detach --tty --publish-all --env-file=/path/to/file whiletruedo/minecraft
# Docker
$ docker run --detach --tty --publish-all --env-file=/path/to/file whiletruedo/minecraft
Variables
Minecraft can be tuned and configured to your liking via server properties. You can adjust various settings and behavior. For a complete list of supported options, please have a look at the envfile.sample. The Minecraft Wiki provides additional explanations for the properties.
Administration
Sometimes, you need to adjust settings on the fly. Minecraft offers a server console to interact with a running server. This can be useful to promote players to ops or ban players and test some settings.
After starting a container with one of the above commands, you can attach to the container and run server console commands.
# Podman
$ podman attach CONTAINERID
help
[19:57:07] [Server thread/INFO]: /advancement (grant|revoke)
[19:57:07] [Server thread/INFO]: /attribute <target> <attribute> (base|get|modifier)
[19:57:07] [Server thread/INFO]: /ban <targets> [<reason>]
[19:57:07] [Server thread/INFO]: /ban-ip <target> [<reason>]
[19:57:07] [Server thread/INFO]: /banlist [ips|players]
...
[19:57:07] [Server thread/INFO]: /worldborder (add|center|damage|get|set|warning)
[19:57:07] [Server thread/INFO]: /xp -> experience
/op mumbojumbo
[19:59:25] [Server thread/INFO]: Made MumboJumbo a server operator
After doing your administration, you can detach from the container with
Ctrl+p Ctrl+q
.
Please check here to get detailed documentation about the possible commands.
Known Issues
None.
Changelog
The repository contains a curated, chronological changelog, maintained by the owner for each release/tag.
Contribute
Thank you so much for considering to contribute! We are happy, when someone is joining the hard work. Please feel free to contribute, after having a look at the Conventions.
See who has contributed already in the KUDOS.txt.
Develop
The repository has some prepared build scripts and a configuration file. Normally, you want to do something like:
- Check/Review/Edit .minecraft.conf
- Do everything else, you need to tweak
- Ensure, that new files are covered in tests/test.sh
- Run the tests
bash tests/test.sh
- Build a new container
bash build/build.sh
Test
Some minimal testing is provided in the tests directory. You can run the tests with the below command.
# Run tests
$ bash tests/test.sh
License
Except where otherwise noted, all work is licensed under a GNU General Public License v3.0 or later.
Contact
Please feel free to get in touch with the developers and contributors.