indemnity83/minecraft
A stupid simple docker image for running Minecraft
411
An extreemly basic minecraft service container
The container is based on openjdk:15-jdk-alpine and will likely compile for any of Alpines supported architectures, however, the only image that is compiled and tagged is the linux/amd64
. Feel free to make a PR to expand the build process in Makefile.
The container is built to run a singe minecraft server instance and to be adminstrated using RCON. The image starts, grabs the jar file for the server you specified if a minecraft_server.jar doesn't already exist and runs supervisor to start the actuall minecraft server as well as a web based RCON client on port 4326.
If you want to run Forge, Spigot or some other flavor you'll need to patch the minecraft_server.jar file outside of this image. Don't forget to update the minecraft_server.jar.sha1 as we do check it before launching to make sure things haven't been corrupted somehow.
Here are some example snippets to help you get started creating a container.
docker create \
--name=minecraft \
-v /path/to/minecraft/instance:/minecraft \
-p 25565:25565
-p 25575:25575
-p 4326:4326
-p 4327:4327
indemnity83/minecraft
MC_VERSION
- [default: latest] The Minecraft version to download if JAR_FILE
does not existJAVA_XMX
- [default: 1024m] Specifies the maximum memory allocation pool for the minecraft serverJAVA_XMS
- [default: 1024m] Specifies the minitial memory allocation pool for the minecraft serverJAVA_ARGS
- Additional java arguments to be passed on launchJAR_FILE
- [default: minecraft_server.jar] The name of the jar file to executeJAR_ARGS
- Additional minecraft arguments to be passed on launchMinecraft requires that you accept their EULA before running the server. This means the first time you run the container with an empty volume, it will fail. Simply find the 'eula.txt' file that was created and mark your acceptance. You may want to take this opportunity to update the server.properties
file too. Once you're ready, restart the container and your world should be created.
Once the container is running the easiest way to interact with it is using RCON. But you can also attach the container using docker attach
if that is your style.
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
docker pull indemnity83/minecraft