Docker image with Minecraft Server Java Edition
245
Docker image with Minecraft Server Java Editionā .
The image is currently available on hub.docker.comā and contains:
You need to create/use a working directory where the server will be storing all files.
If your working directory is empty, a latest server.jar file will be downloaded from the mojang.com site and all files will be created automatically.
Example of this directory:
./minecraft-server
āāā banned-ips.json
āāā banned-players.json
āāā eula.txt
āāā home
āāā logs
āāā ops.json
āāā server.jar
āāā server.properties
āāā supervisord.log
āāā usercache.json
āāā whitelist.json
āāā world
docker run -d --restart unless-stopped --name minecraft \
--cpus=2 --memory=5G --memory-swap=7G \
-v "<minecraft working directory>:/opt/minecraft-server" \
-e MINECRAFT_MEMORY_INIT=2G \
-e MINECRAFT_MEMORY=4G \
-e TZ=America/New_York \
-p 25580:80 -p 25522:22 -p 25565:25565 \
rev9en/minecraft
After the launch you can:
ssh mcuser@server-address -p 25522 (default password: mcuser)Example output from the web server:
{
"name": "minecraft server status",
"status": "OK",
"address": "localhost:25565",
"ip": "172.10.10.10",
"version": "1.16.5",
"description": "Hardcore Server",
"external_ip": "172.10.10.10",
"external_port_open": true,
"players_count": 2,
"players_max": 10,
"latency": 5.8,
"ping": 2.018
}
docker stop minecraft
docker logs minecraft - f
Content type
Image
Digest
sha256:7c4c54904ā¦
Size
287.5 MB
Last updated
over 1 year ago
docker pull rev9en/minecraft