Minecraft, Docker-Compose, Console Commands
I run a few Minecraft servers for my kids using docker-compose and the excellent itzg docker images.
Sometimes they request I tweak the game rules and I need to connect to the console of a running server.
Make sure the container you are trying to connect to has the following docker-compose options:
1 | stdin_open: true |
The java Minecraft server service in my docker-compose currently looks like this:
1 | minecraft-java: |
Start up the servers and run docker container ls
to find out the final name docker-compose assigned to the container. Mine was minecraft_minecraft-java_1
.
Now run docker attach minecraft_minecraft-java_1
and you will be in console mode and able to run gamerule
commands etc.