mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2026-06-06 18:59:44 +00:00
Compare commits
41 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 4017ef54dd | |||
| ffec50141a | |||
| 54027049d3 | |||
| 4c2829e3d2 | |||
| 69e308d420 | |||
| ad46f10b55 | |||
| cd0fdfc95b | |||
| d95abfce82 | |||
| 942a125e04 | |||
| eaf7b28ae9 | |||
| a3677d5aa8 | |||
| f927933c46 | |||
| 5ab83bcb21 | |||
| e6a5a95ce4 | |||
| fdf5fb46bc | |||
| 8c6ca5e999 | |||
| bb2b9eeea9 | |||
| d1cbce3f89 | |||
| 55b5f6821f | |||
| 2cc4f8e55a | |||
| 2f515e1927 | |||
| 0be8968e7e | |||
| a5e756c86f | |||
| 957d11655b | |||
| 50c22ac469 | |||
| 81e1cd8cfd | |||
| 8387e9bd26 | |||
| 4afdb289c0 | |||
| fe637353d8 | |||
| 9160501f0a | |||
| 6eba5062ec | |||
| fc96723db1 | |||
| 8d3e461b4c | |||
| fd73417411 | |||
| 1207b9a685 | |||
| e6259bfd9d | |||
| b5e7b952e4 | |||
| ac5b960182 | |||
| 3299dec733 | |||
| 578f06087f | |||
| fb364e8301 |
+61
-10
@@ -5,14 +5,17 @@ on:
|
|||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
- openj9
|
- openj9
|
||||||
|
- openj9-11
|
||||||
- openj9-nightly
|
- openj9-nightly
|
||||||
- adopt11
|
- adopt11
|
||||||
- adopt13
|
- adopt13
|
||||||
- adopt14
|
- adopt14
|
||||||
- adopt15
|
- adopt15
|
||||||
|
- test/*
|
||||||
tags:
|
tags:
|
||||||
- "[0-9]+.[0-9]+.[0-9]+"
|
- "[0-9]+.[0-9]+.[0-9]+"
|
||||||
- "[0-9]+.[0-9]+.[0-9]+-openj9"
|
- "[0-9]+.[0-9]+.[0-9]+-openj9"
|
||||||
|
- "[0-9]+.[0-9]+.[0-9]+-openj9-11"
|
||||||
- "[0-9]+.[0-9]+.[0-9]+-openj9-nightly"
|
- "[0-9]+.[0-9]+.[0-9]+-openj9-nightly"
|
||||||
- "[0-9]+.[0-9]+.[0-9]+-adopt11"
|
- "[0-9]+.[0-9]+.[0-9]+-adopt11"
|
||||||
- "[0-9]+.[0-9]+.[0-9]+-adopt13"
|
- "[0-9]+.[0-9]+.[0-9]+-adopt13"
|
||||||
@@ -21,7 +24,7 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-20.04
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
@@ -32,20 +35,68 @@ jobs:
|
|||||||
build:
|
build:
|
||||||
needs:
|
needs:
|
||||||
- test
|
- test
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-20.04
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: Build and push Docker images
|
- name: Prepare
|
||||||
uses: docker/build-push-action@v1.1.0
|
id: prep
|
||||||
|
run: |
|
||||||
|
DOCKER_IMAGE=itzg/minecraft-server
|
||||||
|
VERSION=edge
|
||||||
|
if [[ $GITHUB_REF == refs/tags/* ]]; then
|
||||||
|
VERSION=${GITHUB_REF#refs/tags/}
|
||||||
|
fi
|
||||||
|
if [[ $GITHUB_REF == refs/heads/* ]]; then
|
||||||
|
VERSION=${GITHUB_REF#refs/heads/}
|
||||||
|
if [[ $VERSION == master ]]; then
|
||||||
|
VERSION=latest
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
TAGS="${DOCKER_IMAGE}:${VERSION//\//-}"
|
||||||
|
echo ::set-output name=tags::${TAGS}
|
||||||
|
echo ::set-output name=cache_from::${TAGS}
|
||||||
|
echo ::set-output name=version::${VERSION//\//-}
|
||||||
|
echo ::set-output name=cache_version::${VERSION//\//-}
|
||||||
|
|
||||||
|
- name: Setup Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v1
|
||||||
|
|
||||||
|
- name: Cache Docker layers
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: /tmp/.buildx-cache
|
||||||
|
key: ${{ runner.os }}-buildx-${{ steps.prep.outputs.cache_version }}-${{ github.sha }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-buildx-${{ steps.prep.outputs.cache_version }}-
|
||||||
|
${{ runner.os }}-buildx-
|
||||||
|
|
||||||
|
- name: Login to DockerHub
|
||||||
|
uses: docker/login-action@v1
|
||||||
with:
|
with:
|
||||||
repository: itzg/minecraft-server
|
|
||||||
username: ${{ secrets.DOCKER_USER }}
|
username: ${{ secrets.DOCKER_USER }}
|
||||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||||
tag_with_ref: true
|
|
||||||
tag_with_sha: false
|
- name: Build and push
|
||||||
cache_froms: itzg/minecraft-server:latest
|
id: docker_build
|
||||||
add_git_labels: true
|
uses: docker/build-push-action@v2
|
||||||
labels: org.opencontainers.image.url=https://github.com/itzg/docker-minecraft-server,org.opencontainers.image.documentation=https://github.com/itzg/docker-minecraft-server
|
with:
|
||||||
|
context: .
|
||||||
|
file: ./Dockerfile
|
||||||
|
# ensure latest base image is used
|
||||||
|
pull: true
|
||||||
|
# publish
|
||||||
push: true
|
push: true
|
||||||
|
# tags determined by prep step
|
||||||
|
tags: ${{ steps.prep.outputs.tags }}
|
||||||
|
cache-from: type=local,src=/tmp/.buildx-cache
|
||||||
|
cache-to: type=local,dest=/tmp/.buildx-cache
|
||||||
|
labels: |
|
||||||
|
org.opencontainers.image.documentation=https://github.com/itzg/docker-minecraft-server
|
||||||
|
org.opencontainers.image.version=${{ steps.prep.outputs.version }}
|
||||||
|
org.opencontainers.image.source=https://github.com/itzg/docker-minecraft-server
|
||||||
|
org.opencontainers.image.revision=${{ github.sha }}
|
||||||
|
|
||||||
|
- name: Image digest
|
||||||
|
run: echo ${{ steps.docker_build.outputs.digest }}
|
||||||
|
|||||||
+2
-2
@@ -1,4 +1,4 @@
|
|||||||
FROM openjdk:8u212-jre-alpine
|
FROM adoptopenjdk/openjdk13:alpine-jre
|
||||||
|
|
||||||
LABEL org.opencontainers.image.authors="Geoff Bourne <itzgeoff@gmail.com>"
|
LABEL org.opencontainers.image.authors="Geoff Bourne <itzgeoff@gmail.com>"
|
||||||
|
|
||||||
@@ -70,7 +70,7 @@ COPY log4j2.xml /tmp/log4j2.xml
|
|||||||
WORKDIR /data
|
WORKDIR /data
|
||||||
|
|
||||||
ENV UID=1000 GID=1000 \
|
ENV UID=1000 GID=1000 \
|
||||||
JVM_XX_OPTS="-XX:+UseG1GC" MEMORY="1G" \
|
MEMORY="1G" \
|
||||||
TYPE=VANILLA VERSION=LATEST FORGEVERSION=RECOMMENDED SPONGEBRANCH=STABLE SPONGEVERSION= FABRICVERSION=LATEST LEVEL=world \
|
TYPE=VANILLA VERSION=LATEST FORGEVERSION=RECOMMENDED SPONGEBRANCH=STABLE SPONGEVERSION= FABRICVERSION=LATEST LEVEL=world \
|
||||||
PVP=true DIFFICULTY=easy ENABLE_RCON=true RCON_PORT=25575 RCON_PASSWORD=minecraft \
|
PVP=true DIFFICULTY=easy ENABLE_RCON=true RCON_PORT=25575 RCON_PASSWORD=minecraft \
|
||||||
LEVEL_TYPE=DEFAULT SERVER_PORT=25565 ONLINE_MODE=TRUE SERVER_NAME="Dedicated Server" \
|
LEVEL_TYPE=DEFAULT SERVER_PORT=25565 ONLINE_MODE=TRUE SERVER_NAME="Dedicated Server" \
|
||||||
|
|||||||
@@ -116,8 +116,24 @@ to map a directory on your host machine to the container's `/data` directory, su
|
|||||||
|
|
||||||
docker run -d -v /path/on/host:/data ...
|
docker run -d -v /path/on/host:/data ...
|
||||||
|
|
||||||
When attached in this way you can stop the server, edit the configuration under your attached `/path/on/host`
|
When attached in this way you can stop the server, edit the configuration under your attached `/path/on/host` and start the server again with `docker start CONTAINER_ID` to pick up the new configuration.
|
||||||
and start the server again with `docker start CONTAINERID` to pick up the new configuration.
|
|
||||||
|
As example, using Docker compose, create the following `docker-compose.yml` in its own directory and the container will automatically create/attach the relative directory `data` to the container:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
version: "3"
|
||||||
|
|
||||||
|
services:
|
||||||
|
mc:
|
||||||
|
image: itzg/minecraft-server
|
||||||
|
ports:
|
||||||
|
- 25565:25565
|
||||||
|
environment:
|
||||||
|
EULA: "TRUE"
|
||||||
|
volumes:
|
||||||
|
# attach the relative directory 'data' to the container's /data path
|
||||||
|
./data:/data
|
||||||
|
```
|
||||||
|
|
||||||
## Versions
|
## Versions
|
||||||
|
|
||||||
@@ -152,6 +168,7 @@ To use a different version of Java, please use a docker tag to run your Minecraf
|
|||||||
| adopt13 | Uses Java version 13 from AdoptOpenJDK | Alpine Linux |
|
| adopt13 | Uses Java version 13 from AdoptOpenJDK | Alpine Linux |
|
||||||
| adopt11 | Uses Java version 11 from AdoptOpenJDK | Alpine Linux |
|
| adopt11 | Uses Java version 11 from AdoptOpenJDK | Alpine Linux |
|
||||||
| openj9 | Uses Eclipse OpenJ9 JVM | Alpine Linux |
|
| openj9 | Uses Eclipse OpenJ9 JVM | Alpine Linux |
|
||||||
|
| openj9-11 | Uses Eclipse OpenJ9 JVM for Java 11 | Alpine Linux |
|
||||||
| openj9-nightly | Uses Eclipse OpenJ9 JVM testing builds | Alpine Linux |
|
| openj9-nightly | Uses Eclipse OpenJ9 JVM testing builds | Alpine Linux |
|
||||||
| multiarch | Uses Java version 8 latest update | Debian Linux |
|
| multiarch | Uses Java version 8 latest update | Debian Linux |
|
||||||
| multiarch-latest | Uses Java version 15 latest update | Debian Linux |
|
| multiarch-latest | Uses Java version 15 latest update | Debian Linux |
|
||||||
@@ -237,12 +254,13 @@ If you're looking for a simple way to deploy this to the Amazon Web Services Clo
|
|||||||
|
|
||||||
## Running a Forge Server
|
## Running a Forge Server
|
||||||
|
|
||||||
Enable Forge server mode by adding a `-e TYPE=FORGE` to your command-line.
|
Enable [Forge server](http://www.minecraftforge.net/wiki/) mode by adding a `-e TYPE=FORGE` to your command-line.
|
||||||
By default the container will run the `RECOMMENDED` version of [Forge server](http://www.minecraftforge.net/wiki/)
|
|
||||||
but you can also choose to run a specific version with `-e FORGEVERSION=10.13.4.1448`.
|
The overall version is specified by `VERSION`, [as described in the section above](#versions) and will run the recommended Forge version by default. You can also choose to run a specific Forge version with `FORGEVERSION`, such as `-e FORGEVERSION=14.23.5.2854`.
|
||||||
|
|
||||||
$ docker run -d -v /path/on/host:/data \
|
$ docker run -d -v /path/on/host:/data \
|
||||||
-e TYPE=FORGE -e FORGEVERSION=10.13.4.1448 \
|
-e TYPE=FORGE \
|
||||||
|
-e VERSION=1.12.2 -e FORGEVERSION=14.23.5.2854 \
|
||||||
-p 25565:25565 -e EULA=TRUE --name mc itzg/minecraft-server
|
-p 25565:25565 -e EULA=TRUE --name mc itzg/minecraft-server
|
||||||
|
|
||||||
To use a pre-downloaded Forge installer, place it in the attached `/data` directory and
|
To use a pre-downloaded Forge installer, place it in the attached `/data` directory and
|
||||||
@@ -751,12 +769,18 @@ To whitelist players for your Minecraft server, pass the Minecraft usernames sep
|
|||||||
|
|
||||||
If the `WHITELIST` environment variable is not used, any user can join your Minecraft server if it's publicly accessible.
|
If the `WHITELIST` environment variable is not used, any user can join your Minecraft server if it's publicly accessible.
|
||||||
|
|
||||||
|
> NOTE: When `WHITELIST` is used the server property `white-list` will automatically get set to `true`.
|
||||||
|
|
||||||
|
> By default, the players in `WHITELIST` are **added** to the final `whitelist.json` file by the Minecraft server. If you set `OVERRIDE_WHITELIST` to "true" then the `whitelist.json` file will be recreated on each server startup.
|
||||||
|
|
||||||
### Op/Administrator Players
|
### Op/Administrator Players
|
||||||
|
|
||||||
To add more "op" (aka adminstrator) users to your Minecraft server, pass the Minecraft usernames separated by commas via the `OPS` environment variable, such as
|
To add more "op" (aka adminstrator) users to your Minecraft server, pass the Minecraft usernames separated by commas via the `OPS` environment variable, such as
|
||||||
|
|
||||||
docker run -d -e OPS=user1,user2 ...
|
docker run -d -e OPS=user1,user2 ...
|
||||||
|
|
||||||
|
> By default, the players in `OPS` are **added** to the final `ops.json` file by the Minecraft server. If you set `OVERRIDE_OPS` to "true" then the `ops.json` file will be recreated on each server startup.
|
||||||
|
|
||||||
### Server icon
|
### Server icon
|
||||||
|
|
||||||
A server icon can be configured using the `ICON` variable. The image will be automatically
|
A server icon can be configured using the `ICON` variable. The image will be automatically
|
||||||
@@ -764,6 +788,10 @@ downloaded, scaled, and converted from any other image format:
|
|||||||
|
|
||||||
docker run -d -e ICON=http://..../some/image.png ...
|
docker run -d -e ICON=http://..../some/image.png ...
|
||||||
|
|
||||||
|
The server icon which has been set doesn't get overridden by default. It can be changed and overridden by setting `OVERRIDE_ICON` to `TRUE`.
|
||||||
|
|
||||||
|
docker run -d -e ICON=http://..../some/other/image.png -e OVERRIDE_ICON=TRUE...
|
||||||
|
|
||||||
### Rcon
|
### Rcon
|
||||||
|
|
||||||
To use rcon use the `ENABLE_RCON` and `RCON_PASSORD` variables.
|
To use rcon use the `ENABLE_RCON` and `RCON_PASSORD` variables.
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
#set -x
|
#set -x
|
||||||
# Use this variable to indicate a list of branches that docker hub is watching
|
# Use this variable to indicate a list of branches that docker hub is watching
|
||||||
branches_list=('openj9' 'openj9-nightly' 'adopt11' 'adopt13' 'adopt14' 'adopt15' 'multiarch' 'multiarch-latest')
|
branches_list=('openj9' 'openj9-11' 'openj9-nightly' 'adopt11' 'adopt13' 'adopt14' 'adopt15' 'multiarch' 'multiarch-latest')
|
||||||
|
|
||||||
function TrapExit {
|
function TrapExit {
|
||||||
echo "Checking out back in master"
|
echo "Checking out back in master"
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
version: "3"
|
||||||
|
|
||||||
|
services:
|
||||||
|
mc:
|
||||||
|
image: itzg/minecraft-server
|
||||||
|
ports:
|
||||||
|
- 25565:25565
|
||||||
|
environment:
|
||||||
|
EULA: "TRUE"
|
||||||
|
volumes:
|
||||||
|
# attach the relative directory 'data' to the container's /data path
|
||||||
|
./data:/data
|
||||||
+8
-4
@@ -17,8 +17,8 @@ if [[ $PAPER_DOWNLOAD_URL ]]; then
|
|||||||
else
|
else
|
||||||
# PaperMC API v2 docs : https://papermc.io/api/docs/swagger-ui/index.html?configUrl=/api/openapi/swagger-config
|
# PaperMC API v2 docs : https://papermc.io/api/docs/swagger-ui/index.html?configUrl=/api/openapi/swagger-config
|
||||||
|
|
||||||
build=$(curl -fsSL "https://papermc.io/api/v2/projects/paper/versions/${VANILLA_VERSION}" -H "accept: application/json" \
|
build=${PAPERBUILD:=$(curl -fsSL "https://papermc.io/api/v2/projects/paper/versions/${VANILLA_VERSION}" -H "accept: application/json" \
|
||||||
| jq '.builds[-1]')
|
| jq '.builds[-1]')}
|
||||||
case $? in
|
case $? in
|
||||||
0)
|
0)
|
||||||
;;
|
;;
|
||||||
@@ -28,7 +28,7 @@ else
|
|||||||
VANILLA_VERSION=$(echo "$versions" | jq -r '.versions[-1]')
|
VANILLA_VERSION=$(echo "$versions" | jq -r '.versions[-1]')
|
||||||
log "WARN: using ${VANILLA_VERSION} since that's the latest provided by PaperMC"
|
log "WARN: using ${VANILLA_VERSION} since that's the latest provided by PaperMC"
|
||||||
# re-execute the current script with the newly computed version
|
# re-execute the current script with the newly computed version
|
||||||
exec $0 "$@"
|
exec "$0" "$@"
|
||||||
fi
|
fi
|
||||||
log "ERROR: ${VANILLA_VERSION} is not published by PaperMC"
|
log "ERROR: ${VANILLA_VERSION} is not published by PaperMC"
|
||||||
log " Set VERSION to one of the following: "
|
log " Set VERSION to one of the following: "
|
||||||
@@ -56,6 +56,10 @@ else
|
|||||||
zarg=(-z "$SERVER")
|
zarg=(-z "$SERVER")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
log "Removing old PaperMC versions ..."
|
||||||
|
paperJarSearchString=${SERVER/$build/[0-9]*}
|
||||||
|
find . -name "$paperJarSearchString" ! -name "$SERVER" -delete -print
|
||||||
|
|
||||||
log "Downloading PaperMC $VANILLA_VERSION (build $build) ..."
|
log "Downloading PaperMC $VANILLA_VERSION (build $build) ..."
|
||||||
curl -fsSL -o "$SERVER" "${zarg[@]}" \
|
curl -fsSL -o "$SERVER" "${zarg[@]}" \
|
||||||
"https://papermc.io/api/v2/projects/paper/versions/${VANILLA_VERSION}/builds/${build}/downloads/${SERVER}" \
|
"https://papermc.io/api/v2/projects/paper/versions/${VANILLA_VERSION}/builds/${build}/downloads/${SERVER}" \
|
||||||
@@ -71,4 +75,4 @@ export TYPE=SPIGOT
|
|||||||
export SKIP_LOG4J_CONFIG=true
|
export SKIP_LOG4J_CONFIG=true
|
||||||
|
|
||||||
# Continue to Final Setup
|
# Continue to Final Setup
|
||||||
exec ${SCRIPTS:-/}start-finalSetupWorld $@
|
exec ${SCRIPTS:-/}start-finalSetupWorld "$@"
|
||||||
|
|||||||
+13
-6
@@ -81,16 +81,23 @@ if [[ "$MODS" ]]; then
|
|||||||
do
|
do
|
||||||
if isURL $i; then
|
if isURL $i; then
|
||||||
log "Downloading mod/plugin $i ..."
|
log "Downloading mod/plugin $i ..."
|
||||||
effective_url=$(resolveEffectiveUrl "$i")
|
if isValidFileURL jar "$i"; then
|
||||||
if isValidFileURL jar "${effective_url}"; then
|
if ! curl -fsSL -o "${out_dir}/$(getFilenameFromUrl "${i}")" "${i}"; then
|
||||||
out_file=$(getFilenameFromUrl "${effective_url}")
|
|
||||||
if ! curl -fsSL -o "${out_dir}/$out_file" "${effective_url}"; then
|
|
||||||
log "ERROR: failed to download from $i into $out_dir"
|
log "ERROR: failed to download from $i into $out_dir"
|
||||||
exit 2
|
exit 2
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
log "ERROR: $effective_url resolved from $i is not a valid jar URL"
|
effective_url=$(resolveEffectiveUrl "$i")
|
||||||
exit 2
|
if isValidFileURL jar "${effective_url}"; then
|
||||||
|
out_file=$(getFilenameFromUrl "${effective_url}")
|
||||||
|
if ! curl -fsSL -o "${out_dir}/$out_file" "${effective_url}"; then
|
||||||
|
log "ERROR: failed to download from $i into $out_dir"
|
||||||
|
exit 2
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
log "ERROR: $effective_url resolved from $i is not a valid jar URL"
|
||||||
|
exit 2
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
log "ERROR Invalid URL given in MODS: $i"
|
log "ERROR Invalid URL given in MODS: $i"
|
||||||
|
|||||||
+30
-18
@@ -3,28 +3,40 @@
|
|||||||
. ${SCRIPTS:-/}start-utils
|
. ${SCRIPTS:-/}start-utils
|
||||||
|
|
||||||
if [ -n "$OPS" ]; then
|
if [ -n "$OPS" ]; then
|
||||||
log "Setting/adding ops"
|
log "Updating ops"
|
||||||
rm -rf /data/ops.txt.converted
|
rm -f /data/ops.txt.converted
|
||||||
echo $OPS | awk -v RS=, '{print}' > /data/ops.txt
|
echo $OPS | awk -v RS=, '{print}' > /data/ops.txt
|
||||||
|
|
||||||
|
if isTrue "${OVERRIDE_OPS}"; then
|
||||||
|
log "Recreating ops.json file at server startup"
|
||||||
|
rm -f /data/ops.json
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "$WHITELIST" ]; then
|
if [ -n "$WHITELIST" ]; then
|
||||||
log "Setting whitelist"
|
log "Updating whitelist"
|
||||||
rm -rf /data/white-list.txt.converted
|
rm -f /data/white-list.txt.converted
|
||||||
echo $WHITELIST | awk -v RS=, '{print}' > /data/white-list.txt
|
echo $WHITELIST | awk -v RS=, '{print}' > /data/white-list.txt
|
||||||
|
|
||||||
|
if isTrue "${OVERRIDE_WHITELIST}"; then
|
||||||
|
log "Recreating whitelist.json file at server startup"
|
||||||
|
rm -f /data/whitelist.json
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "$ICON" -a ! -e server-icon.png ]; then
|
if [ -n "$ICON" ]; then
|
||||||
log "Using server icon from $ICON..."
|
if [ ! -e server-icon.png ] || [ "${OVERRIDE_ICON}" == "TRUE" ]; then
|
||||||
# Not sure what it is yet...call it "img"
|
log "Using server icon from $ICON..."
|
||||||
curl -sSL -o /tmp/icon.img $ICON
|
# Not sure what it is yet...call it "img"
|
||||||
specs=$(identify /tmp/icon.img | awk '{print $2,$3}')
|
curl -sSL -o /tmp/icon.img $ICON
|
||||||
if [ "$specs" = "PNG 64x64" ]; then
|
specs=$(identify /tmp/icon.img | awk '{print $2,$3}')
|
||||||
mv /tmp/icon.img /data/server-icon.png
|
if [ "$specs" = "PNG 64x64" ]; then
|
||||||
else
|
mv /tmp/icon.img /data/server-icon.png
|
||||||
log "Converting image to 64x64 PNG..."
|
else
|
||||||
convert /tmp/icon.img -resize 64x64! /data/server-icon.png
|
log "Converting image to 64x64 PNG..."
|
||||||
fi
|
convert /tmp/icon.img -resize 64x64! /data/server-icon.png
|
||||||
|
fi
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! isTrue ${SKIP_LOG4J_CONFIG}; then
|
if ! isTrue ${SKIP_LOG4J_CONFIG}; then
|
||||||
@@ -146,11 +158,11 @@ JVM_OPTS="-Xms${INIT_MEMORY} -Xmx${MAX_MEMORY} ${JVM_OPTS}"
|
|||||||
function copyFilesForCurseForge() {
|
function copyFilesForCurseForge() {
|
||||||
# copy player modification files unconditionally since their
|
# copy player modification files unconditionally since their
|
||||||
# processing into json is additive anyway
|
# processing into json is additive anyway
|
||||||
[ -f /data/ops.txt ] && cp -f /data/ops.txt ${FTB_DIR}/
|
[ -f /data/ops.txt ] && cp -f /data/ops.txt "${FTB_DIR}/"
|
||||||
[ -f /data/white-list.txt ] && cp -f /data/white-list.txt ${FTB_DIR}/
|
[ -f /data/white-list.txt ] && cp -f /data/white-list.txt "${FTB_DIR}/"
|
||||||
|
|
||||||
if [ ! -e "${FTB_DIR}/server-icon.png" -a -e /data/server-icon.png ]; then
|
if [ ! -e "${FTB_DIR}/server-icon.png" -a -e /data/server-icon.png ]; then
|
||||||
cp -f /data/server-icon.png ${FTB_DIR}/
|
cp -f /data/server-icon.png "${FTB_DIR}/"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cp -f /data/eula.txt "${FTB_DIR}/"
|
cp -f /data/eula.txt "${FTB_DIR}/"
|
||||||
|
|||||||
+2
-1
@@ -145,7 +145,8 @@ requireVar() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function writeEula() {
|
function writeEula() {
|
||||||
if ! echo "# Generated via Docker on $(date)
|
if ! echo "# Generated via Docker
|
||||||
|
# $(date)
|
||||||
eula=${EULA,,}
|
eula=${EULA,,}
|
||||||
" >/data/eula.txt; then
|
" >/data/eula.txt; then
|
||||||
log "ERROR: unable to write eula to /data. Please make sure attached directory is writable by uid=${UID}"
|
log "ERROR: unable to write eula to /data. Please make sure attached directory is writable by uid=${UID}"
|
||||||
|
|||||||
Reference in New Issue
Block a user