mirror of
https://github.com/itzg/docker-minecraft-server
synced 2024-12-13 05:42:28 +00:00
Add /plugins mount for external bukkit plugins
Add TYPE=BUKKIT documentation
This commit is contained in:
parent
13a6d91295
commit
582c60cd03
3 changed files with 60 additions and 2 deletions
|
@ -14,7 +14,8 @@ RUN useradd -M -s /bin/false --uid 1000 minecraft \
|
||||||
&& mkdir /data \
|
&& mkdir /data \
|
||||||
&& mkdir /config \
|
&& mkdir /config \
|
||||||
&& mkdir /mods \
|
&& mkdir /mods \
|
||||||
&& chown minecraft:minecraft /data /config /mods
|
&& mkdir /plugins
|
||||||
|
&& chown minecraft:minecraft /data /config /mods /plugins
|
||||||
|
|
||||||
EXPOSE 25565
|
EXPOSE 25565
|
||||||
|
|
||||||
|
@ -24,6 +25,7 @@ COPY start-minecraft.sh /start-minecraft
|
||||||
VOLUME ["/data"]
|
VOLUME ["/data"]
|
||||||
VOLUME ["/mods"]
|
VOLUME ["/mods"]
|
||||||
VOLUME ["/config"]
|
VOLUME ["/config"]
|
||||||
|
VOLUME ["/plugins"]
|
||||||
COPY server.properties /tmp/server.properties
|
COPY server.properties /tmp/server.properties
|
||||||
WORKDIR /data
|
WORKDIR /data
|
||||||
|
|
||||||
|
|
|
@ -146,6 +146,57 @@ This works well if you want to have a common set of modules in a separate
|
||||||
location, but still have multiple worlds with different server requirements
|
location, but still have multiple worlds with different server requirements
|
||||||
in either persistent volumes or a downloadable archive.
|
in either persistent volumes or a downloadable archive.
|
||||||
|
|
||||||
|
## Running a Bukkit/Spigot server
|
||||||
|
|
||||||
|
Enable Bukkit/Spigot server mode by adding a `-e TYPE=BUKKIT -e VERSION=1.8` or `-e TYPE=SPIGOT -e VERSION=1.8` to your command-line.
|
||||||
|
|
||||||
|
The VERSION option should be set to 1.8, as this is the only version of CraftBukkit and Spigot currently
|
||||||
|
available. The latest build in this branch will be used.
|
||||||
|
|
||||||
|
$ docker run -d -v /path/on/host:/data \
|
||||||
|
-e TYPE=SPIGOT -e VERSION=1.8 \
|
||||||
|
-p 25565:25565 -e EULA=TRUE --name mc itzg/minecraft-server
|
||||||
|
|
||||||
|
You can install Bukkit plugins in two ways.
|
||||||
|
|
||||||
|
### Using the /data volume
|
||||||
|
|
||||||
|
This is the easiest way if you are using a persistent `/data` mount.
|
||||||
|
|
||||||
|
To do this, you will need to attach the container's `/data` directory
|
||||||
|
(see "Attaching data directory to host filesystem”).
|
||||||
|
Then, you can add plugins to the `/path/on/host/plugins` folder you chose. From the example above,
|
||||||
|
the `/path/on/host` folder contents look like:
|
||||||
|
|
||||||
|
```
|
||||||
|
/path/on/host
|
||||||
|
├── plugins
|
||||||
|
│ └── ... INSTALL PLUGINS HERE ...
|
||||||
|
├── ops.json
|
||||||
|
├── server.properties
|
||||||
|
├── whitelist.json
|
||||||
|
└── ...
|
||||||
|
```
|
||||||
|
|
||||||
|
If you add plugins while the container is running, you'll need to restart it to pick those
|
||||||
|
up:
|
||||||
|
|
||||||
|
docker stop mc
|
||||||
|
docker start mc
|
||||||
|
|
||||||
|
### Using separate mounts
|
||||||
|
|
||||||
|
This is the easiest way if you are using an ephemeral `/data` filesystem,
|
||||||
|
or downloading a world with the `WORLD` option.
|
||||||
|
|
||||||
|
There is one additional volume that can be mounted; `/plugins`.
|
||||||
|
Any files in this filesystem will be copied over to the main
|
||||||
|
`/data/plugins` filesystem before starting Minecraft.
|
||||||
|
|
||||||
|
This works well if you want to have a common set of plugins in a separate
|
||||||
|
location, but still have multiple worlds with different server requirements
|
||||||
|
in either persistent volumes or a downloadable archive.
|
||||||
|
|
||||||
## Using Docker Compose
|
## Using Docker Compose
|
||||||
|
|
||||||
Rather than type the server options below, the port mappings above, etc
|
Rather than type the server options below, the port mappings above, etc
|
||||||
|
|
|
@ -289,6 +289,11 @@ do
|
||||||
cp -rf "$c" /data/config
|
cp -rf "$c" /data/config
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
if [ "$TYPE" = "SPIGOT" ]; then
|
||||||
|
echo Copying any Bukkit plugins over
|
||||||
|
if [ -d /plugins ]; then
|
||||||
|
cp -r /plugins /data
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
exec java $JVM_OPTS -jar $SERVER
|
exec java $JVM_OPTS -jar $SERVER
|
||||||
|
|
Loading…
Reference in a new issue