2021-01-04 14:23:47 +00:00
|
|
|
# Docker Minecraft
|
2020-10-13 08:09:21 +00:00
|
|
|
|
2021-01-04 14:23:47 +00:00
|
|
|
Wrapper to run Minecraft in Docker
|
|
|
|
|
|
|
|
|
|
|
|
## Build Image
|
|
|
|
|
|
|
|
```./build.sh```
|
|
|
|
|
|
|
|
## Get Minecraft Sever For Testing
|
|
|
|
|
|
|
|
```./get_minecraft.sh```
|
|
|
|
|
|
|
|
## Run Server
|
|
|
|
|
|
|
|
```docker-compose up -d```
|
|
|
|
|
|
|
|
```docker run -it --name minecraft -p 25565:25565 -v $PWD:/server -e MAX_MEM=1G magmise/minecraft```
|
|
|
|
|
|
|
|
## Get Logs
|
|
|
|
|
|
|
|
```docker-compose logs```
|
|
|
|
|
|
|
|
```docker logs minecraft```
|
|
|
|
|
|
|
|
## Send Command to Server
|
|
|
|
|
|
|
|
```docker-compose exec cmd say hello```
|
|
|
|
|
|
|
|
```docker exec minecraft cmd say hello```
|
|
|
|
|
|
|
|
## Attach to Container
|
|
|
|
|
|
|
|
```docker attach minecraft```
|
|
|
|
|
|
|
|
To detach use ```ctrl+p ctrl+q```
|
|
|
|
|
|
|
|
Don't use ```ctrl+c``` to disconnect, it will kill the server
|
|
|
|
|
|
|
|
## Varialbles
|
|
|
|
|
|
|
|
### JAR
|
|
|
|
|
|
|
|
Default is ```server.jar```
|
|
|
|
|
|
|
|
### MIN_MEM
|
|
|
|
|
|
|
|
Default is ```512M```
|
|
|
|
|
|
|
|
### MAX_MEM
|
|
|
|
|
|
|
|
Default is ```1G```
|
|
|
|
|
|
|
|
### STOP
|
|
|
|
|
|
|
|
Default is ```stop```
|
|
|
|
|
|
|
|
This would be used for the Bungee where the stop command is ```end```
|
|
|
|
|
2021-01-04 14:24:19 +00:00
|
|
|
|