- Downloads newest server jar file automatically.
- Sets EULA based on provided environmental variable.
- Bind mounts local directory for easy access to your Minecraft worlds. Can be replaced with a named volume if no easy access is required.
- Starts server with
-Xmx4G -Xms4G -jar server.jar noguijava parameters. Those can be adjusted inside of start.sh file.
docker build -f Dockerfile -t image:tag .docker run \
-it \
--rm \
-v /home/user/Minecraft/data:/data \
-e EULA=TRUE \
-p 25565:25565 \
image:tagDocker Compose depends on a local .env file to:
- Accept EULA
- Select an image
- Set bind mount directory for server data
MINECRAFT_DATA=/home/user/Minecraft/data
MINECRAFT_IMAGE=image:tag
docker compose up- Stop baking the jar file into the image and download it when starting the container instead.