mirror of
https://github.com/itzg/docker-minecraft-server
synced 2024-12-17 15:43:06 +00:00
Auto-merging via docker-versions-create
This commit is contained in:
commit
9b6b813fe8
5 changed files with 37 additions and 19 deletions
31
README.md
31
README.md
|
@ -145,7 +145,7 @@ By default, the container will download the latest version of the "vanilla" [Min
|
|||
* [Enabling Autopause](#enabling-autopause)
|
||||
* [Running on RaspberryPi](#running-on-raspberrypi)
|
||||
|
||||
<!-- Added by: runner, at: Tue Jul 13 00:03:33 UTC 2021 -->
|
||||
<!-- Added by: runner, at: Thu Jul 15 13:34:00 UTC 2021 -->
|
||||
|
||||
<!--te-->
|
||||
|
||||
|
@ -212,7 +212,7 @@ When attached in this way you can stop the server, edit the configuration under
|
|||
With Docker Compose, setting up a host attached directory is even easier since relative paths can be configured. For example, with the following `docker-compose.yml` Docker will automatically create/attach the relative directory `minecraft-data` to the container.
|
||||
|
||||
```yaml
|
||||
version: "3.8"
|
||||
version: "3"
|
||||
|
||||
services:
|
||||
mc:
|
||||
|
@ -221,6 +221,9 @@ services:
|
|||
- 25565:25565
|
||||
environment:
|
||||
EULA: "TRUE"
|
||||
tty: true
|
||||
stdin_open: true
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
# attach a directory relative to the directory containing this compose file
|
||||
- ./minecraft-data:/data
|
||||
|
@ -343,20 +346,18 @@ every time you want to create new Minecraft server, you can now use
|
|||
`docker-compose.yml` file like the following:
|
||||
|
||||
```yml
|
||||
version: "3.8"
|
||||
version: "3"
|
||||
|
||||
minecraft-server:
|
||||
image: itzg/minecraft-server
|
||||
|
||||
ports:
|
||||
- "25565:25565"
|
||||
|
||||
environment:
|
||||
EULA: "TRUE"
|
||||
|
||||
tty: true
|
||||
stdin_open: true
|
||||
restart: always
|
||||
services:
|
||||
mc:
|
||||
image: itzg/minecraft-server
|
||||
ports:
|
||||
- 25565:25565
|
||||
environment:
|
||||
EULA: "TRUE"
|
||||
tty: true
|
||||
stdin_open: true
|
||||
restart: unless-stopped
|
||||
```
|
||||
|
||||
and in the same directory as that file run
|
||||
|
|
17
examples/docker-compose-spiget.yml
Normal file
17
examples/docker-compose-spiget.yml
Normal file
|
@ -0,0 +1,17 @@
|
|||
version: "3"
|
||||
|
||||
services:
|
||||
mc:
|
||||
# Only using IMAGE variable to allow for local testing
|
||||
image: ${IMAGE:-itzg/minecraft-server}
|
||||
ports:
|
||||
- 25565:25565
|
||||
environment:
|
||||
EULA: "TRUE"
|
||||
TYPE: SPIGOT
|
||||
SPIGET_RESOURCES: 9089,34315,3836
|
||||
volumes:
|
||||
- data:/data
|
||||
|
||||
volumes:
|
||||
data: {}
|
|
@ -32,7 +32,7 @@ log "Using Airplane-${AIRPLANE_BRANCH} branch"
|
|||
|
||||
export SERVER=airplane-${AIRPLANE_BRANCH}-${AIRPLANE_BUILD}.jar
|
||||
|
||||
if [ ! -f "$SERVER" ] || isTrue "$FORCE_REDOWNLOAD"; then
|
||||
if [ ! -f "$SERVER" ] || isTrue "${FORCE_REDOWNLOAD:-false}"; then
|
||||
downloadUrl="https://ci.tivy.ca/job/Airplane-${AIRPLANE_BRANCH}/${AIRPLANE_BUILD}/artifact/launcher-airplane.jar"
|
||||
log "Downloading Airplane from $downloadUrl ..."
|
||||
curl -fsSL -o "$SERVER" "$downloadUrl"
|
||||
|
|
|
@ -10,7 +10,7 @@ isDebugging && set -x
|
|||
: ${FORCE_REDOWNLOAD:=false}
|
||||
|
||||
if [[ ${PURPUR_BUILD} == LATEST ]]; then
|
||||
PURPUR_BUILD=$(curl -fsSL "https://purpur.pl3x.net/api/v1/purpur/${VANILLA_VERSION}" |
|
||||
PURPUR_BUILD=$(curl -fsSL "https://api.pl3x.net/v2/purpur/${VANILLA_VERSION}" |
|
||||
jq -r '.builds.latest' || echo "")
|
||||
if [[ -z ${PURPUR_BUILD} ]]; then
|
||||
log "ERROR: Failed to locate a Purpur build for ${VANILLA_VERSION}."
|
||||
|
@ -22,7 +22,7 @@ fi
|
|||
export SERVER="purpur-${VANILLA_VERSION}-${PURPUR_BUILD}.jar"
|
||||
|
||||
if [ ! -f "$SERVER" ] || isTrue "$FORCE_REDOWNLOAD"; then
|
||||
downloadUrl="https://purpur.pl3x.net/api/v1/purpur/${VANILLA_VERSION}/${PURPUR_BUILD}/download"
|
||||
downloadUrl="https://api.pl3x.net/v2/purpur/${VANILLA_VERSION}/${PURPUR_BUILD}/download"
|
||||
log "Downloading Purpur from $downloadUrl ..."
|
||||
if ! curl -fsSL -o "$SERVER" "$downloadUrl"; then
|
||||
log "ERROR: failed to download from $downloadUrl (status=$?)"
|
||||
|
|
|
@ -29,7 +29,7 @@ getResourceFromSpiget() {
|
|||
mkdir -p /data/plugins
|
||||
|
||||
if [ -f /data/plugins/.${resource} ]; then
|
||||
log "Resource '${$resource}' already downloaded"
|
||||
log "Resource '${resource}' already downloaded"
|
||||
else
|
||||
tmpfile="/tmp/${resource}.zip"
|
||||
url="https://api.spiget.org/v2/resources/${resource}/download"
|
||||
|
|
Loading…
Reference in a new issue