mimise/spigot

By mimise

Updated over 3 years ago

Image
0

3.0K

spigot

Minecraft Micro Service tries to get a minecraft server as a micro service.

This repository holds spigot containers.

This image provides support for amd64 and arm/v7 (Raspberry Pi).

Versions

This image provides all spigot versions from version 1.8.

Start server

docker run -d --name <container_name> -e EULA=true mimise/spigot:<minecraft version>

Note: Replace the placeholders.

Agree minecraft EULA

By passing the environment variable EULA=true to the container you agree to the minecraft EULA. Without to set the environment variable EULA to true the minecraft container will not start.

Set RAM parameter

You can set the initial (min) and the maximum RAM to start the minecraft server by following environment parameters.

... -e MIN_RAM=1024M ...
... -e MAX_RAM=1024M ...

The default of both values is 1024M.

Run commands on server

You can execute commands on server using docker exec.

docker exec <container_name> rcon <command>

Note: Replace the placeholders.

Use rcon from outside docker

If you want to use rcon outside from docker you need to set the rcon password.

... -e RCON_PASSWORD=<password> ...

You also need to publish the rcon port to the outside of docker.

... -p <outside rcon port>:25575 ...

Now you can connect to the minecraft server using rcon.

If you want to change the rcon port inside the container.

... -e RCON_PORT=<port> ...

Files

To get a feeling of a micro service the files separated between configs and data.

Data

To bind data to a local folder use.

... -v `pwd`/data:/data ...

Data:

  • banned-ips.json
  • banned-players.json
  • ops.json
  • whitelist.json
  • worlds/
  • worlds/usercache.json

Please note, that all worlds saved in the folder worlds.

Config

If you want to change settings you can use the config folder. Just place the file in a config folder and mount it to the container.

... -v `pwd`/config:/config ...

Config:

  • server.properties
  • bukkit.yml
  • commands.yml
  • permissions.yml
  • spigot.yml
Other

There are other files from a minecraft server where you not have access to.

  • eula.txt
  • logs/

Why I can't access the logs?

As this image tries to create a micro service logs should handled via the container stdout.

Plugins

You can install plugins in two different ways:

Mount /plugins folder

... -v `pwd`/plugins:/plugins ...

Create new image

Create a new Dockerfile.

FROM mimise/spigot:<minecraft version>

COPY plugin.jar /plugins/plugin.jar

And build the docker image.

docker build -t own-spigot .

World

You can mount the world to the host:

... -v `pwd`/worlds:/worlds ...

If you having a network with minigames for example please consider adding the world in the image and use that to run your server.

Create a new Dockerfile and add following contents.

FROM mimise/spigot:<minecraft version>

COPY game-map /worlds/game-map

And build the docker image.

docker build -t game-server .

PROXY

If you want to use this minecraft container with a proxy you need to deploy on of these proxies.

That the proxy can communicate with the minecraft container you need to add it to the same network.

... --network="proxy" ...

Either you change the settings manually in the config or you can use the provided environment variable to change the settings automatically.

... -e PROXY=true ...

As the container are in the same network and you join via the proxy you don't need to expose the port from this container to the host. So you can remove -p 25565:25565 from the run command.

TODO

  • don't run application with root

Docker Pull Command

docker pull mimise/spigot