mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2026-02-17 15:13:55 +00:00
Compare commits
31 Commits
2021.4.0-j
...
1.11.0-ope
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d919881092 | ||
|
|
e406fee8fa | ||
|
|
3497b06391 | ||
|
|
65b0e0d8bb | ||
|
|
c5b9c199d6 | ||
|
|
5a61465c09 | ||
|
|
8a324c30de | ||
|
|
e0cdf9e2ce | ||
|
|
57740cb749 | ||
|
|
966c74cd08 | ||
|
|
d84b58dfd0 | ||
|
|
7aaf106ffe | ||
|
|
5f77902441 | ||
|
|
c200efc9c9 | ||
|
|
e924126a56 | ||
|
|
bbd3d3cfc1 | ||
|
|
d77c19c69b | ||
|
|
7ee77e4f47 | ||
|
|
84d0cff4c8 | ||
|
|
70519b9764 | ||
|
|
4683ea496d | ||
|
|
0e3a82f9d3 | ||
|
|
d2554f2271 | ||
|
|
55e62371ac | ||
|
|
c9a5fcfac8 | ||
|
|
a1f8154d05 | ||
|
|
e5d0a9362a | ||
|
|
ca9c280b0b | ||
|
|
6ef4e984c7 | ||
|
|
ea4f78346a | ||
|
|
007f9426bf |
25
.circleci/config.yml
Normal file
25
.circleci/config.yml
Normal file
@@ -0,0 +1,25 @@
|
||||
version: 2
|
||||
jobs:
|
||||
minecraft_server:
|
||||
docker:
|
||||
- image: circleci/buildpack-deps:stable
|
||||
steps:
|
||||
- checkout
|
||||
- setup_remote_docker
|
||||
- run:
|
||||
name: Build image
|
||||
command: docker build -t itzg/minecraft-server:${CIRCLE_BRANCH} .
|
||||
# - run:
|
||||
# name: Build arm v7 image
|
||||
# command: docker build -t itzg/minecraft-server:${CIRCLE_BRANCH}-arm-v7 --platform linux/arm/v7 --build-arg ARCH=armv7 .
|
||||
|
||||
workflows:
|
||||
version: 2
|
||||
build:
|
||||
jobs:
|
||||
- minecraft_server:
|
||||
filters:
|
||||
branches:
|
||||
ignore:
|
||||
- armv7
|
||||
- multiarch
|
||||
75
.github/workflows/build-multiarch.yml
vendored
75
.github/workflows/build-multiarch.yml
vendored
@@ -3,78 +3,23 @@ on:
|
||||
push:
|
||||
branches:
|
||||
- multiarch
|
||||
- java8-multiarch
|
||||
- multiarch-latest
|
||||
- java15
|
||||
- test/multiarch/*
|
||||
tags:
|
||||
- "[0-9]+.[0-9]+.[0-9]+-multiarch"
|
||||
- "[0-9]+.[0-9]+.[0-9]+-multiarch-latest"
|
||||
- "[0-9]+.[0-9]+.[0-9]+-java15"
|
||||
|
||||
jobs:
|
||||
docker-buildx:
|
||||
runs-on: ubuntu-20.04
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2.2.0
|
||||
|
||||
- name: Prepare
|
||||
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
|
||||
- name: Get branch name
|
||||
uses: nelonoel/branch-name@v1
|
||||
- name: Docker Buildx
|
||||
uses: ilteoood/docker_buildx@1.0.4
|
||||
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 }}-
|
||||
publish: true
|
||||
imageName: itzg/minecraft-server
|
||||
tag: ${{ env.BRANCH_NAME }}
|
||||
dockerHubUser: ${{ secrets.DOCKER_USER }}
|
||||
dockerHubPassword: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v1
|
||||
|
||||
- name: Login to DockerHub
|
||||
uses: docker/login-action@v1
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USER }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
- name: Build and push
|
||||
id: docker_build
|
||||
uses: docker/build-push-action@v2
|
||||
with:
|
||||
context: .
|
||||
file: ./Dockerfile
|
||||
platforms: linux/amd64,linux/arm/v7,linux/arm64
|
||||
push: ${{ github.event_name != 'pull_request' }}
|
||||
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.source=https://github.com/itzg/docker-minecraft-server
|
||||
org.opencontainers.image.version=${{ steps.prep.outputs.version }}
|
||||
org.opencontainers.image.revision=${{ github.sha }}
|
||||
|
||||
- name: Image digest
|
||||
run: echo ${{ steps.docker_build.outputs.digest }}
|
||||
|
||||
80
.github/workflows/main.yml
vendored
80
.github/workflows/main.yml
vendored
@@ -4,22 +4,24 @@ on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- java8
|
||||
- openj9
|
||||
- openj9-11
|
||||
- openj9-nightly
|
||||
- adopt11
|
||||
- test/*
|
||||
- adopt13
|
||||
- adopt14
|
||||
- adopt15
|
||||
tags:
|
||||
- "[0-9]+.[0-9]+.[0-9]+"
|
||||
- "[0-9]+.[0-9]+.[0-9]+-java8"
|
||||
- "[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]+-adopt11"
|
||||
- "[0-9]+.[0-9]+.[0-9]+-adopt13"
|
||||
- "[0-9]+.[0-9]+.[0-9]+-adopt14"
|
||||
- "[0-9]+.[0-9]+.[0-9]+-adopt15"
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-20.04
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
@@ -30,68 +32,20 @@ jobs:
|
||||
build:
|
||||
needs:
|
||||
- test
|
||||
runs-on: ubuntu-20.04
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Prepare
|
||||
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
|
||||
- name: Build and push Docker images
|
||||
uses: docker/build-push-action@v1.1.0
|
||||
with:
|
||||
repository: itzg/minecraft-server
|
||||
username: ${{ secrets.DOCKER_USER }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
- name: Build and push
|
||||
id: docker_build
|
||||
uses: docker/build-push-action@v2
|
||||
with:
|
||||
context: .
|
||||
file: ./Dockerfile
|
||||
# ensure latest base image is used
|
||||
pull: true
|
||||
# publish
|
||||
tag_with_ref: true
|
||||
tag_with_sha: false
|
||||
cache_froms: itzg/minecraft-server:latest
|
||||
add_git_labels: true
|
||||
labels: org.opencontainers.image.url=https://github.com/itzg/docker-minecraft-server,org.opencontainers.image.documentation=https://github.com/itzg/docker-minecraft-server
|
||||
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 }}
|
||||
|
||||
11
BUILDING.md
11
BUILDING.md
@@ -1,11 +0,0 @@
|
||||
Ensure buildx/BuildKit support is enabled and run:
|
||||
|
||||
```shell script
|
||||
docker buildx build --platform=linux/arm64 --platform=linux/arm/v7 --platform=linux/amd64 --tag itzg/minecraft-server:multiarch --push .
|
||||
```
|
||||
|
||||
To build for local testing, use:
|
||||
|
||||
```shell script
|
||||
docker buildx build --platform=linux/amd64 --tag mc-multiarch --load .
|
||||
```
|
||||
62
Dockerfile
62
Dockerfile
@@ -1,29 +1,32 @@
|
||||
FROM ubuntu:18.04
|
||||
FROM adoptopenjdk/openjdk8-openj9:alpine
|
||||
|
||||
LABEL org.opencontainers.image.authors="Geoff Bourne <itzgeoff@gmail.com>"
|
||||
|
||||
RUN apt-get update \
|
||||
&& DEBIAN_FRONTEND=noninteractive \
|
||||
apt-get install -y \
|
||||
openjdk-8-jre-headless \
|
||||
imagemagick \
|
||||
gosu \
|
||||
sudo \
|
||||
net-tools \
|
||||
curl wget \
|
||||
jq \
|
||||
dos2unix \
|
||||
mysql-client \
|
||||
tzdata \
|
||||
rsync \
|
||||
nano \
|
||||
unzip \
|
||||
knockd \
|
||||
ttf-dejavu \
|
||||
&& apt-get clean
|
||||
# upgrade all packages since alpine jre8 base image tops out at 8u212
|
||||
RUN apk -U --no-cache upgrade
|
||||
|
||||
RUN addgroup --gid 1000 minecraft \
|
||||
&& adduser --system --shell /bin/false --uid 1000 --ingroup minecraft --home /data minecraft
|
||||
RUN apk add --no-cache -U \
|
||||
openssl \
|
||||
imagemagick \
|
||||
lsof \
|
||||
su-exec \
|
||||
shadow \
|
||||
bash \
|
||||
curl iputils wget \
|
||||
git \
|
||||
jq \
|
||||
mysql-client \
|
||||
tzdata \
|
||||
rsync \
|
||||
nano \
|
||||
sudo \
|
||||
knock \
|
||||
ttf-dejavu
|
||||
|
||||
RUN addgroup -g 1000 minecraft \
|
||||
&& adduser -Ss /bin/false -u 1000 -G minecraft -h /home/minecraft minecraft \
|
||||
&& mkdir -m 777 /data \
|
||||
&& chown minecraft:minecraft /data /home/minecraft
|
||||
|
||||
COPY files/sudoers* /etc/sudoers.d
|
||||
|
||||
@@ -31,9 +34,9 @@ EXPOSE 25565 25575
|
||||
|
||||
# hook into docker BuildKit --platform support
|
||||
# see https://docs.docker.com/engine/reference/builder/#automatic-platform-args-in-the-global-scope
|
||||
ARG TARGETOS
|
||||
ARG TARGETARCH
|
||||
ARG TARGETVARIANT
|
||||
ARG TARGETOS=linux
|
||||
ARG TARGETARCH=amd64
|
||||
ARG TARGETVARIANT=""
|
||||
|
||||
ARG EASY_ADD_VER=0.7.1
|
||||
ADD https://github.com/itzg/easy-add/releases/download/${EASY_ADD_VER}/easy-add_${TARGETOS}_${TARGETARCH}${TARGETVARIANT} /usr/bin/easy-add
|
||||
@@ -68,11 +71,10 @@ WORKDIR /data
|
||||
|
||||
ENV UID=1000 GID=1000 \
|
||||
MEMORY="1G" \
|
||||
TYPE=VANILLA VERSION=LATEST \
|
||||
ENABLE_RCON=true RCON_PORT=25575 RCON_PASSWORD=minecraft \
|
||||
SERVER_PORT=25565 ONLINE_MODE=TRUE SERVER_NAME="Dedicated Server" \
|
||||
ENABLE_AUTOPAUSE=false AUTOPAUSE_TIMEOUT_EST=3600 AUTOPAUSE_TIMEOUT_KN=120 AUTOPAUSE_TIMEOUT_INIT=600 \
|
||||
AUTOPAUSE_PERIOD=10 AUTOPAUSE_KNOCK_INTERFACE=eth0
|
||||
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 \
|
||||
LEVEL_TYPE=DEFAULT SERVER_PORT=25565 ONLINE_MODE=TRUE SERVER_NAME="Dedicated Server" \
|
||||
ENABLE_AUTOPAUSE=false AUTOPAUSE_TIMEOUT_EST=3600 AUTOPAUSE_TIMEOUT_KN=120 AUTOPAUSE_TIMEOUT_INIT=600 AUTOPAUSE_PERIOD=10
|
||||
|
||||
COPY start* /
|
||||
COPY health.sh /
|
||||
|
||||
134
README.md
134
README.md
@@ -116,24 +116,8 @@ to map a directory on your host machine to the container's `/data` directory, su
|
||||
|
||||
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` and start the server again with `docker start CONTAINER_ID` 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
|
||||
```
|
||||
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 CONTAINERID` to pick up the new configuration.
|
||||
|
||||
## Versions
|
||||
|
||||
@@ -160,31 +144,21 @@ the server jar remain in the `/data` directory. It is safe to remove those._
|
||||
|
||||
To use a different version of Java, please use a docker tag to run your Minecraft server.
|
||||
|
||||
| Tag name | Java version | Linux | JVM Type | Architecture |
|
||||
| -------------- | -------------|--------|----------|-------------------|
|
||||
| latest | 11 | Alpine | Hotspot | amd64 |
|
||||
| java8 | 8 | Alpine | Hotspot | amd64 |
|
||||
| java8-multiarch | 8 | Debian | Hotspot | amd64,arm64,armv7 |
|
||||
| java15 | 15 | Debian | Hotspot | amd64,arm64,armv7 |
|
||||
| adopt11 | 11 | Alpine | Hotspot | amd64 |
|
||||
| openj9 | 8 | Alpine | OpenJ9 | amd64 |
|
||||
| openj9-11 | 11 | Alpine | OpenJ9 | amd64 |
|
||||
| multiarch | 11 | Debian | Hotspot | amd64,arm64,armv7 |
|
||||
| multiarch-latest | 15+ | Debian | Hotspot | amd64,arm64,armv7 |
|
||||
| Tag name | Description | Linux |
|
||||
| -------------- | ------------------------------------------- | ------------ |
|
||||
| latest | **Default**. Uses Java version 8 update 212 | Alpine Linux |
|
||||
| adopt14 | Uses Java version 14 latest update | Alpine Linux |
|
||||
| adopt13 | Uses Java version 13 latest update | Alpine Linux |
|
||||
| adopt11 | Uses Java version 11 latest update | Alpine Linux |
|
||||
| openj9 | Uses Eclipse OpenJ9 JVM | Alpine Linux |
|
||||
| openj9-nightly | Uses Eclipse OpenJ9 JVM testing builds | Alpine Linux |
|
||||
| multiarch | Uses Java version 8 latest update | Debian Linux |
|
||||
|
||||
For example, to use Java version 15 on any supported architecture:
|
||||
For example, to use a Java version 13:
|
||||
|
||||
docker run --name mc itzg/minecraft-server:java15
|
||||
docker run --name mc itzg/minecraft-server:adopt13
|
||||
|
||||
> Keep in mind that some versions of Minecraft server can't work on the newest versions of Java. Also, FORGE doesn't support openj9 JVM implementation.
|
||||
|
||||
### Deprecated Image Tags
|
||||
|
||||
The following image tags have been deprecated and are no longer receiving updates:
|
||||
- adopt13
|
||||
- adopt14
|
||||
- adopt15
|
||||
- openj9-nightly
|
||||
Keep in mind that some versions of Minecraft server can't work on the newest versions of Java. Also, FORGE doesn't support openj9 JVM implementation.
|
||||
|
||||
## Healthcheck
|
||||
|
||||
@@ -206,22 +180,22 @@ healthy
|
||||
|
||||
Some orchestration systems, such as Portainer, don't allow for disabling the default `HEALTHCHECK` declared by this image. In those cases you can approximate the disabling of healthchecks by setting the environment variable `DISABLE_HEALTHCHECK` to `true`.
|
||||
|
||||
## Autopause
|
||||
## Autopause (experimental)
|
||||
|
||||
### Description
|
||||
|
||||
> EXPERIMENTAL: this feature only works with default bridge networking using official Docker distributions. Host networking and container management software, such as Portainer, and NAS solutions do not seem to provide compatible networking.
|
||||
|
||||
There are various bug reports on [Mojang](https://bugs.mojang.com) about high CPU usage of servers with newer versions, even with few or no clients connected (e.g. [this one](https://bugs.mojang.com/browse/MC-149018), in fact the functionality is based on [this comment in the thread](https://bugs.mojang.com/browse/MC-149018?focusedCommentId=593606&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-593606)).
|
||||
|
||||
An autopause functionality has been added to this image to monitor whether clients are connected to the server. If for a specified time no client is connected, the Java process is stopped. When knocking on the server port (e.g. by the ingame Multiplayer server overview), the process is resumed. The experience for the client does not change.
|
||||
|
||||
Of course, even loaded chunks are not ticked when the process is stopped.
|
||||
|
||||
From the server's point of view, the pausing causes a single tick to take as long as the process is stopped, so the server watchdog might intervene after the process is continued, possibly forcing a container restart. To prevent this, ensure that the `max-tick-time` in the `server.properties` file is set correctly. Non-vanilla versions might have their own configuration file, you might have to disable their watchdogs separately (e.g. PAPER Servers).
|
||||
From the server's point of view, the pausing causes a single tick to take as long as the process is stopped, so the server watchdog might intervene after the process is continued, possibly forcing a container restart. To prevent this, ensure that the `max-tick-time` in the `server.properties` file is set correctly.
|
||||
|
||||
On startup the `server.properties` file is checked and, if applicable, a warning is printed to the terminal. When the server is created (no data available in the persistent directory), the properties file is created with the Watchdog disabled.
|
||||
|
||||
The utility used to wake the server (`knock(d)`) works at network interface level. So the correct interface has to be set using the `AUTOPAUSE_KNOCK_INTERFACE` variable when using non-default networking environments (e.g. host-networking, Portainer oder NAS solutions). See the description of the variable below.
|
||||
|
||||
A starting, example compose file has been provided in [examples/docker-compose-autopause.yml](examples/docker-compose-autopause.yml).
|
||||
|
||||
### Enabling Autopause
|
||||
@@ -232,7 +206,7 @@ Enable the Autopause functionality by setting:
|
||||
-e ENABLE_AUTOPAUSE=TRUE
|
||||
```
|
||||
|
||||
The following environment variables define the behaviour of auto-pausing:
|
||||
There are 4 more environment variables that define the behaviour:
|
||||
* `AUTOPAUSE_TIMEOUT_EST`, default `3600` (seconds)
|
||||
describes the time between the last client disconnect and the pausing of the process (read as timeout established)
|
||||
* `AUTOPAUSE_TIMEOUT_INIT`, default `600` (seconds)
|
||||
@@ -241,8 +215,6 @@ describes the time between server start and the pausing of the process, when no
|
||||
describes the time between knocking of the port (e.g. by the main menu ping) and the pausing of the process, when no client connects inbetween (read as timeout knocked)
|
||||
* `AUTOPAUSE_PERIOD`, default `10` (seconds)
|
||||
describes period of the daemonized state machine, that handles the pausing of the process (resuming is done independently)
|
||||
* `AUTOPAUSE_KNOCK_INTERFACE`, default `eth0`
|
||||
<br>Describes the interface passed to the `knockd` daemon. If the default interface does not work, run the `ifconfig` command inside the container and derive the interface receiving the incoming connection from its output. The passed interface must exist inside the container. Using the loopback interface (`lo`) does likely not yield the desired results.
|
||||
|
||||
## Deployment Templates and Examples
|
||||
|
||||
@@ -261,13 +233,12 @@ If you're looking for a simple way to deploy this to the Amazon Web Services Clo
|
||||
|
||||
## Running a Forge Server
|
||||
|
||||
Enable [Forge server](http://www.minecraftforge.net/wiki/) mode by adding a `-e TYPE=FORGE` to your command-line.
|
||||
|
||||
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`.
|
||||
Enable Forge server 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`.
|
||||
|
||||
$ docker run -d -v /path/on/host:/data \
|
||||
-e TYPE=FORGE \
|
||||
-e VERSION=1.12.2 -e FORGEVERSION=14.23.5.2854 \
|
||||
-e TYPE=FORGE -e FORGEVERSION=10.13.4.1448 \
|
||||
-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
|
||||
@@ -487,18 +458,6 @@ A [Tuinity](https://github.com/Spottedleaf/Tuinity) server, which is a fork of P
|
||||
|
||||
> **NOTE** only `VERSION=LATEST` is supported
|
||||
|
||||
## Running a Purpur server
|
||||
|
||||
A [Purpur](https://purpur.pl3x.net/) server, which is "a fork of Paper and Tuinity with the goal of providing new and interesting configuration options".
|
||||
|
||||
-e TYPE=PURPUR
|
||||
|
||||
> NOTE: the `VERSION` variable is used to lookup a build of Purpur to download
|
||||
|
||||
Extra variables:
|
||||
- `PURPUR_BUILD=LATEST` : set a specific Purpur build to use
|
||||
- `FORCE_REDOWNLOAD=false` : set to true to force the located server jar to be re-downloaded
|
||||
|
||||
## Running a Magma server
|
||||
|
||||
A [Magma](https://magmafoundation.org/) server, which is a combination of Forge and PaperMC, can be used with
|
||||
@@ -527,7 +486,7 @@ A [Catserver](http://catserver.moe/) type server can be used with
|
||||
|
||||
## Running a server with a Feed the Beast modpack
|
||||
|
||||
> **NOTE** requires one of the Debian based images listed in [the Java versions section](#running-minecraft-server-on-different-java-version).
|
||||
> **NOTE** requires `itzg/minecraft-server:multiarch` image
|
||||
|
||||
[Feed the Beast application](https://www.feed-the-beast.com/) modpacks are supported by using `-e TYPE=FTBA` (**note** the "A" at the end of the type). This server type will automatically take care of downloading and installing the modpack and appropriate version of Forge, so the `VERSION` does not need to be specified.
|
||||
|
||||
@@ -576,12 +535,6 @@ The following example uses `/modpacks` as the container path as the pre-download
|
||||
-e CF_SERVER_MOD=/modpacks/SkyFactory_4_Server_4.1.0.zip \
|
||||
-p 25565:25565 -e EULA=TRUE --name mc itzg/minecraft-server
|
||||
|
||||
#### Modpack data directory
|
||||
|
||||
By default, CurseForge modpacks are expanded into the sub-directory `/data/FeedTheBeast` and executed from there. (The default location was chosen for legacy reasons, when Curse and FTB were maintained together.)
|
||||
|
||||
The directory can be changed by setting `CF_BASE_DIR`, such as `-e CF_BASE_DIR=/data`.
|
||||
|
||||
#### Buggy start scripts
|
||||
|
||||
Some modpacks have buggy or overly complex start scripts. You can avoid using the bundled start script and use this image's standard server-starting logic by adding `-e USE_MODPACK_START_SCRIPT=false`.
|
||||
@@ -788,18 +741,12 @@ 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.
|
||||
|
||||
> 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
|
||||
|
||||
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 ...
|
||||
|
||||
> 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
|
||||
|
||||
A server icon can be configured using the `ICON` variable. The image will be automatically
|
||||
@@ -807,10 +754,6 @@ downloaded, scaled, and converted from any other image format:
|
||||
|
||||
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
|
||||
|
||||
To use rcon use the `ENABLE_RCON` and `RCON_PASSORD` variables.
|
||||
@@ -977,7 +920,7 @@ environment variable set to `false`, such as
|
||||
### Level Type and Generator Settings
|
||||
|
||||
By default, a standard world is generated with hills, valleys, water, etc. A different level type can
|
||||
be configured by setting `LEVEL_TYPE` to an expected type, for example
|
||||
be configured by setting `LEVEL_TYPE` to an expected type, such as
|
||||
|
||||
- DEFAULT
|
||||
- FLAT
|
||||
@@ -985,8 +928,6 @@ be configured by setting `LEVEL_TYPE` to an expected type, for example
|
||||
- AMPLIFIED
|
||||
- CUSTOMIZED
|
||||
- BUFFET
|
||||
- BIOMESOP (Biomes O' Plenty for 1.12 and older)
|
||||
- BIOMESOPLENTY (Biomes O' Plenty for 1.15 and above)
|
||||
|
||||
Descriptions are available at the [gamepedia](http://minecraft.gamepedia.com/Server.properties).
|
||||
|
||||
@@ -1117,18 +1058,19 @@ is passed to `docker run`.
|
||||
|
||||
### Memory Limit
|
||||
|
||||
By default, the image declares an initial and maximum Java memory-heap limit of 1 GB. There are several ways to adjust the memory settings:
|
||||
By default, the image declares a Java initial and maximum memory limit of 1 GB. There are several
|
||||
ways to adjust the memory settings:
|
||||
|
||||
- `MEMORY`: "1G" by default, can be used to adjust both initial (`Xms`) and max (`Xmx`) memory heap settings of the JVM
|
||||
- `INIT_MEMORY`: independently sets the initial heap size
|
||||
- `MAX_MEMORY`: independently sets the max heap size
|
||||
- `MEMORY`, "1G" by default, can be used to adjust both initial (`Xms`) and max (`Xmx`)
|
||||
memory settings of the JVM
|
||||
- `INIT_MEMORY`, independently sets the initial heap size
|
||||
- `MAX_MEMORY`, independently sets the max heap size
|
||||
|
||||
The values of all three are passed directly to the JVM and support format/units as `<size>[g|G|m|M|k|K]`. For example:
|
||||
The values of all three are passed directly to the JVM and support format/units as
|
||||
`<size>[g|G|m|M|k|K]`. For example:
|
||||
|
||||
-e MEMORY=2G
|
||||
|
||||
> NOTE: the settings above only set the Java **heap** limits. Memory resource requests and limits on the overall container should also account for non-heap memory usage. An extra 25% is [a general best practice](https://dzone.com/articles/best-practices-java-memory-arguments-for-container).
|
||||
|
||||
### JVM Options
|
||||
|
||||
General JVM options can be passed to the Minecraft Server invocation by passing a `JVM_OPTS`
|
||||
@@ -1138,6 +1080,14 @@ via a `JVM_XX_OPTS` environment variable.
|
||||
For some cases, if e.g. after removing mods, it could be necessary to startup minecraft with an additional `-D` parameter like `-Dfml.queryResult=confirm`. To address this you can use the environment variable `JVM_DD_OPTS`, which builds the params from a given list of values separated by space, but without the `-D` prefix. To make things running under systems (e.g. Plesk), which doesn't allow `=` inside values, a `:` (colon) could be used instead. The upper example would look like this:
|
||||
`JVM_DD_OPTS=fml.queryResult:confirm`, and will be converted to `-Dfml.queryResult=confirm`.
|
||||
|
||||
The container uses [OpenJ9](https://www.eclipse.org/openj9/docs) and a couple of J9 options are
|
||||
simplified by environment variables:
|
||||
|
||||
- `-e TUNE_VIRTUALIZED=TRUE` : enables the option to
|
||||
[optimize for virtualized environments](https://www.eclipse.org/openj9/docs/xtunevirtualized/)
|
||||
- `-e TUNE_NURSERY_SIZES=TRUE` : configures nursery sizes where the initial size is 50%
|
||||
of the `MAX_MEMORY` and the max size is 80%.
|
||||
|
||||
### Enable Remote JMX for Profiling
|
||||
|
||||
To enable remote JMX, such as for profiling with VisualVM or JMC, add the environment variable `ENABLE_JMX=true` and add a port forwarding of TCP port 7091, such as:
|
||||
@@ -1183,4 +1133,4 @@ To run this image on a RaspberryPi 3 B+, 4, or newer, use the image tag
|
||||
|
||||
itzg/minecraft-server:multiarch
|
||||
|
||||
> NOTE: you may need to lower the memory allocation, such as `-e MEMORY=750m`
|
||||
> NOTE: you may need to lower the memory allocation, such as `-e MEMORY=750m`
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
#set -x
|
||||
# Use this variable to indicate a list of branches that docker hub is watching
|
||||
branches_list=('java8' 'java8-multiarch' 'openj9' 'openj9-11' 'adopt11' 'java15' 'multiarch' 'multiarch-latest')
|
||||
branches_list=('openj9' 'openj9-nightly' 'adopt11' 'adopt13' 'adopt14' 'adopt15' 'multiarch' 'multiarch-latest')
|
||||
|
||||
function TrapExit {
|
||||
echo "Checking out back in master"
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 34 KiB |
@@ -1,12 +0,0 @@
|
||||
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
|
||||
@@ -1,3 +1,3 @@
|
||||
Place server [modpacks downloaded from CurseForge](https://www.curseforge.com/minecraft/modpacks) in this directory.
|
||||
Please server [modpacks downloaded from CurseForge](https://www.curseforge.com/minecraft/modpacks) in this directory.
|
||||
|
||||
The example [`docker-compose-curseforge.yml`](../docker-compose-curseforge.yml) references a modpack downloaded from <https://www.curseforge.com/minecraft/modpacks/skyfactory-4/files/2787018>.
|
||||
|
||||
@@ -2,48 +2,23 @@
|
||||
|
||||
. /autopause/autopause-fcns.sh
|
||||
|
||||
. ${SCRIPTS:-/}start-utils
|
||||
. /start-utils
|
||||
|
||||
|
||||
autopause_error_loop() {
|
||||
logAutopause "Available interfaces within the docker container:"
|
||||
INTERFACES=$(echo /sys/class/net/*)
|
||||
INTERFACES=${INTERFACES//\/sys\/class\/net\//}
|
||||
logAutopause " $INTERFACES"
|
||||
logAutopause "Please set the environment variable AUTOPAUSE_KNOCK_INTERFACE to the interface that handles incoming connections."
|
||||
logAutopause "If unsure which interface to choose, run the ifconfig command in the container."
|
||||
logAutopause "Autopause failed to initialize. This log entry will be printed every 30 minutes."
|
||||
sudo /usr/sbin/knockd -c /tmp/knockd-config.cfg -d
|
||||
if [ $? -ne 0 ] ; then
|
||||
while :
|
||||
do
|
||||
sleep 1800
|
||||
logAutopause "Autopause failed to initialize."
|
||||
if [[ -n $(ps -o comm | grep java) ]] ; then
|
||||
break
|
||||
fi
|
||||
sleep 0.1
|
||||
done
|
||||
}
|
||||
|
||||
# wait for java process to be started
|
||||
while :
|
||||
do
|
||||
if java_process_exists ; then
|
||||
break
|
||||
fi
|
||||
sleep 0.1
|
||||
done
|
||||
|
||||
# check for interface existence
|
||||
if [[ -z "$AUTOPAUSE_KNOCK_INTERFACE" ]] ; then
|
||||
logAutopause "AUTOPAUSE_KNOCK_INTERFACE variable must not be empty!"
|
||||
autopause_error_loop
|
||||
fi
|
||||
if ! [[ -d "/sys/class/net/$AUTOPAUSE_KNOCK_INTERFACE" ]] ; then
|
||||
logAutopause "Selected interface \"$AUTOPAUSE_KNOCK_INTERFACE\" does not exist!"
|
||||
autopause_error_loop
|
||||
fi
|
||||
|
||||
sudo /usr/sbin/knockd -c /tmp/knockd-config.cfg -d -i "$AUTOPAUSE_KNOCK_INTERFACE"
|
||||
if [ $? -ne 0 ] ; then
|
||||
logAutopause "Failed to start knockd daemon."
|
||||
logAutopause "Probable cause: Unable to attach to interface \"$AUTOPAUSE_KNOCK_INTERFACE\"."
|
||||
autopause_error_loop
|
||||
logAutopause "Possible cause: docker's host network mode."
|
||||
logAutopause "Recreate without host mode or disable autopause functionality."
|
||||
logAutopause "Stopping server."
|
||||
killall -SIGTERM java
|
||||
exit 1
|
||||
fi
|
||||
|
||||
STATE=INIT
|
||||
|
||||
@@ -5,15 +5,11 @@ current_uptime() {
|
||||
}
|
||||
|
||||
java_running() {
|
||||
[[ $( ps -ax -o stat,comm | grep 'java' | awk '{ print $1 }') =~ ^S.*$ ]]
|
||||
}
|
||||
|
||||
java_process_exists() {
|
||||
[[ -n "$(ps -ax -o comm | grep 'java')" ]]
|
||||
[[ $( ps -a -o stat,comm | grep 'java' | awk '{ print $1 }') =~ ^S.*$ ]]
|
||||
}
|
||||
|
||||
rcon_client_exists() {
|
||||
[[ -n "$(ps -ax -o comm | grep 'rcon-cli')" ]]
|
||||
[[ -n "$(ps -a -o comm | grep 'rcon-cli')" ]]
|
||||
}
|
||||
|
||||
mc_server_listening() {
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
[unpauseMCServer-server]
|
||||
sequence = 25565
|
||||
seq_timeout = 1
|
||||
command = /usr/sbin/gosu minecraft:minecraft /autopause/resume.sh
|
||||
command = /sbin/su-exec minecraft:minecraft /autopause/resume.sh
|
||||
tcpflags = syn
|
||||
[unpauseMCServer-rcon]
|
||||
sequence = 25575
|
||||
seq_timeout = 1
|
||||
command = /usr/sbin/gosu minecraft:minecraft /autopause/resume.sh
|
||||
command = /sbin/su-exec minecraft:minecraft /autopause/resume.sh
|
||||
tcpflags = syn
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
. /start-utils
|
||||
|
||||
if [[ $( ps -ax -o stat,comm | grep 'java' | awk '{ print $1 }') =~ ^S.*$ ]] ; then
|
||||
if [[ $( ps -a -o stat,comm | grep 'java' | awk '{ print $1 }') =~ ^S.*$ ]] ; then
|
||||
# save world
|
||||
rcon-cli save-all >/dev/null
|
||||
|
||||
@@ -17,5 +17,5 @@ if [[ $( ps -ax -o stat,comm | grep 'java' | awk '{ print $1 }') =~ ^S.*$ ]] ; t
|
||||
|
||||
# finally pause the process
|
||||
logAutopauseAction "Pausing Java process"
|
||||
pkill -STOP java
|
||||
killall -q -STOP java
|
||||
fi
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
. /start-utils
|
||||
|
||||
if [[ $( ps -ax -o stat,comm | grep 'java' | awk '{ print $1 }') =~ ^T.*$ ]] ; then
|
||||
if [[ $( ps -a -o stat,comm | grep 'java' | awk '{ print $1 }') =~ ^T.*$ ]] ; then
|
||||
logAutopauseAction "Knocked, resuming Java process"
|
||||
pkill -CONT java
|
||||
killall -q -CONT java
|
||||
fi
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
%minecraft ALL=(ALL) NOPASSWD:/usr/bin/pkill
|
||||
%minecraft ALL=(ALL) NOPASSWD:/usr/bin/killall
|
||||
%minecraft ALL=(ALL) NOPASSWD:/usr/sbin/knockd
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
if isTrue "${DISABLE_HEALTHCHECK}"; then
|
||||
echo "Healthcheck disabled"
|
||||
exit 0
|
||||
elif isTrue "${ENABLE_AUTOPAUSE}" && [[ "$( ps -ax -o stat,comm | grep 'java' | awk '{ print $1 }')" =~ ^T.*$ ]]; then
|
||||
elif isTrue "${ENABLE_AUTOPAUSE}" && [[ "$( ps -a -o stat,comm | grep 'java' | awk '{ print $1 }')" =~ ^T.*$ ]]; then
|
||||
echo "Java process suspended by Autopause function"
|
||||
exit 0
|
||||
else
|
||||
|
||||
2
start
2
start
@@ -40,7 +40,7 @@ if [ $(id -u) = 0 ]; then
|
||||
echo 'hosts: files dns' > /etc/nsswitch.conf
|
||||
fi
|
||||
|
||||
exec gosu ${runAsUser}:${runAsGroup} ${SCRIPTS:-/}start-configuration $@
|
||||
exec su-exec ${runAsUser}:${runAsGroup} ${SCRIPTS:-/}start-configuration $@
|
||||
else
|
||||
exec ${SCRIPTS:-/}start-configuration $@
|
||||
fi
|
||||
|
||||
@@ -46,15 +46,10 @@ if ! [[ $AUTOPAUSE_TIMEOUT_INIT =~ ^[0-9]+$ ]] ; then
|
||||
export AUTOPAUSE_TIMEOUT_INIT
|
||||
log "Warning: AUTOPAUSE_TIMEOUT_INIT is not numeric, set to 600 (seconds)"
|
||||
fi
|
||||
if [[ "$AUTOPAUSE_KNOCK_INTERFACE" == "lo" ]] ; then
|
||||
log "Warning: AUTOPAUSE_KNOCK_INTERFACE is set to the local loopback interface."
|
||||
log " This is not advisable, as incoming connections are likely not picked up there."
|
||||
log " Continuing with this setting."
|
||||
fi
|
||||
|
||||
if [[ -n "$MAX_TICK_TIME" && "$MAX_TICK_TIME" != "-1" ]] ; then
|
||||
if [[ -n $MAX_TICK_TIME ]] ; then
|
||||
log "Warning: MAX_TICK_TIME is non-default, for autopause to work properly, this check should be disabled (-1 for versions >= 1.8.1)"
|
||||
elif [[ -z "$MAX_TICK_TIME" ]] ; then
|
||||
else
|
||||
if versionLessThan 1.8.1; then
|
||||
# 10 years
|
||||
MAX_TICK_TIME=315360000000
|
||||
|
||||
@@ -1,19 +1,12 @@
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
IFS=$'\n\t'
|
||||
|
||||
. ${SCRIPTS:-/}start-utils
|
||||
|
||||
: ${PROXY:=}
|
||||
: ${RCON_PASSWORD_FILE:=}
|
||||
|
||||
shopt -s nullglob
|
||||
|
||||
#umask 002
|
||||
export HOME=/data
|
||||
|
||||
log "Running as uid=$(id -u) gid=$(id -g) with /data as '$(ls -lnd /data)'"
|
||||
|
||||
if [ ! -e /data/eula.txt ]; then
|
||||
if ! isTrue "$EULA"; then
|
||||
log ""
|
||||
@@ -29,6 +22,15 @@ if [ ! -e /data/eula.txt ]; then
|
||||
fi
|
||||
|
||||
|
||||
log "Running as uid=$(id -u) gid=$(id -g) with /data as '$(ls -lnd /data)'"
|
||||
|
||||
if ! touch /data/.verify_access; then
|
||||
log "ERROR: /data doesn't seem to be writable. Please make sure attached directory is writable by uid=$(id -u)"
|
||||
exit 2
|
||||
fi
|
||||
|
||||
rm /data/.verify_access || true
|
||||
|
||||
if [[ $PROXY ]]; then
|
||||
export http_proxy="$PROXY"
|
||||
export https_proxy="$PROXY"
|
||||
@@ -93,10 +95,6 @@ case "${TYPE^^}" in
|
||||
;;
|
||||
|
||||
FORGE)
|
||||
log "**********************************************************************"
|
||||
log "WARNING: The image tag itzg/minecraft-server:java8 is recommended"
|
||||
log " since some mods require Java 8"
|
||||
log "**********************************************************************"
|
||||
exec ${SCRIPTS:-/}start-deployForge "$@"
|
||||
;;
|
||||
|
||||
@@ -104,11 +102,7 @@ case "${TYPE^^}" in
|
||||
exec ${SCRIPTS:-/}start-deployFabric "$@"
|
||||
;;
|
||||
|
||||
FTBA)
|
||||
exec ${SCRIPTS:-/}start-deployFTBA "$@"
|
||||
;;
|
||||
|
||||
CURSEFORGE|FTB)
|
||||
FTB|CURSEFORGE)
|
||||
exec ${SCRIPTS:-/}start-deployCF "$@"
|
||||
;;
|
||||
|
||||
@@ -140,14 +134,10 @@ case "${TYPE^^}" in
|
||||
exec ${SCRIPTS:-/}start-deployCatserver "$@"
|
||||
;;
|
||||
|
||||
PURPUR)
|
||||
exec ${SCRIPTS:-/}start-deployPurpur "$@"
|
||||
;;
|
||||
|
||||
*)
|
||||
log "Invalid type: '$TYPE'"
|
||||
log "Must be: VANILLA, FORGE, BUKKIT, SPIGOT, PAPER, FTBA (multiarch-only),"
|
||||
log " CURSE_INSTANCE, CURSEFORGE, SPONGEVANILLA, TUINITY, PURPUR"
|
||||
log " CURSE_INSTANCE, CURSEFORGE, SPONGEVANILLA,"
|
||||
log " CUSTOM, MAGMA, MOHIST, CATSERVER"
|
||||
exit 1
|
||||
;;
|
||||
|
||||
@@ -5,11 +5,9 @@ set -e
|
||||
. ${SCRIPTS:-/}start-utils
|
||||
isDebugging && set -x
|
||||
|
||||
: ${FTB_BASE_DIR:=${CF_BASE_DIR:-/data/FeedTheBeast}}
|
||||
export FTB_BASE_DIR
|
||||
|
||||
export FTB_BASE_DIR=/data/FeedTheBeast
|
||||
legacyJavaFixerUrl=https://ftb.forgecdn.net/FTB2/maven/net/minecraftforge/lex/legacyjavafixer/1.0/legacyjavafixer-1.0.jar
|
||||
export TYPE=CURSEFORGE
|
||||
export TYPE=FEED-THE-BEAST
|
||||
|
||||
FTB_SERVER_MOD=${FTB_SERVER_MOD:-$CF_SERVER_MOD}
|
||||
|
||||
|
||||
@@ -17,16 +17,12 @@ if isURL ${CUSTOM_SERVER}; then
|
||||
fi
|
||||
|
||||
elif [[ -f ${CUSTOM_SERVER} ]]; then
|
||||
export SERVER=${CUSTOM_SERVER}
|
||||
|
||||
elif [[ ${GENERIC_PACK} ]]; then
|
||||
log "Using custom server jar from generic pack at ${CUSTOM_SERVER} ..."
|
||||
log "Using custom server jar at ${CUSTOM_SERVER} ..."
|
||||
export SERVER=${CUSTOM_SERVER}
|
||||
|
||||
else
|
||||
log "CUSTOM_SERVER is not properly set to a URL or existing jar file"
|
||||
exit 2
|
||||
|
||||
fi
|
||||
|
||||
export SKIP_LOG4J_CONFIG=true
|
||||
|
||||
@@ -1,72 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
ftbInstallMarker=".ftb-installed"
|
||||
|
||||
. ${SCRIPTS:-/}start-utils
|
||||
isDebugging && set -x
|
||||
set -e
|
||||
|
||||
if ! [[ -v FTB_MODPACK_ID ]]; then
|
||||
log "ERROR FTB_MODPACK_ID is required with TYPE=FTB"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! [[ ${FTB_MODPACK_ID} =~ [0-9]+ ]]; then
|
||||
log "ERROR FTB_MODPACK_ID needs to be numeric"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! [[ -v FTB_MODPACK_VERSION_ID ]]; then
|
||||
if ! FTB_MODPACK_VERSION_ID=$(curl -fsSL https://api.modpacks.ch/public/modpack/${FTB_MODPACK_ID} | jq -r '.versions | sort_by(.updated)[-1].id'); then
|
||||
log "ERROR unable to resolve latest modpack version ID for modpack ${FTB_MODPACK_ID}"
|
||||
exit 1
|
||||
fi
|
||||
elif ! [[ ${FTB_MODPACK_VERSION_ID} =~ [0-9]+ ]]; then
|
||||
log "ERROR FTB_MODPACK_VERSION_ID needs to be numeric"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! [ -f "${ftbInstallMarker}" ] || [ $(cat "${ftbInstallMarker}") != "${FTB_MODPACK_ID}=${FTB_MODPACK_VERSION_ID}" ]; then
|
||||
ftbInstaller=/data/ftb-installer
|
||||
if ! [[ -f "${ftbInstaller}" ]]; then
|
||||
log "Downloading FTB installer"
|
||||
curl -fsSL https://api.modpacks.ch/public/modpack/1/1/server/linux -o "${ftbInstaller}"
|
||||
chmod +x "${ftbInstaller}"
|
||||
fi
|
||||
|
||||
rm -rf forge*jar mods config libraries defaultconfigs changelogs
|
||||
|
||||
log "Installing modpack ID ${FTB_MODPACK_ID}, version ID ${FTB_MODPACK_VERSION_ID}"
|
||||
${ftbInstaller} ${FTB_MODPACK_ID} ${FTB_MODPACK_VERSION_ID} --noscript --auto
|
||||
rm -f forge*installer.jar
|
||||
|
||||
echo "${FTB_MODPACK_ID}=${FTB_MODPACK_VERSION_ID}" > ${ftbInstallMarker}
|
||||
|
||||
writeEula
|
||||
else
|
||||
log "FTB modpack ID ${FTB_MODPACK_ID}, version ID ${FTB_MODPACK_VERSION_ID} is ready to go"
|
||||
fi
|
||||
|
||||
isDebugging && cat version.json
|
||||
forgeVersion=$(jq -r '.targets|unique[] | select(.name == "forge") | .version' version.json)
|
||||
mcVersion=$(jq -r '.targets|unique[] | select(.name == "minecraft") | .version' version.json)
|
||||
|
||||
variants=(
|
||||
forge-${mcVersion}-${forgeVersion}.jar
|
||||
forge-${mcVersion}-${forgeVersion}-universal.jar
|
||||
forge-${mcVersion}-${forgeVersion}-${mcVersion}-universal.jar
|
||||
)
|
||||
for f in ${variants[@]}; do
|
||||
if [ -f $f ]; then
|
||||
export SERVER=$f
|
||||
break
|
||||
fi
|
||||
done
|
||||
if ! [ -v SERVER ]; then
|
||||
log "ERROR unable to locate the installed forge server jar"
|
||||
ls *.jar
|
||||
exit 2
|
||||
fi
|
||||
|
||||
# Continue to Final Setup
|
||||
exec ${SCRIPTS:-/}start-finalSetupWorld $@
|
||||
@@ -1,8 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
. ${SCRIPTS:-/}start-utils
|
||||
|
||||
export TYPE=FORGE
|
||||
: ${FORGEVERSION:=RECOMMENDED}
|
||||
|
||||
if [[ -z $FORGE_INSTALLER && -z $FORGE_INSTALLER_URL ]]; then
|
||||
norm=$VANILLA_VERSION
|
||||
|
||||
@@ -17,8 +17,8 @@ if [[ $PAPER_DOWNLOAD_URL ]]; then
|
||||
else
|
||||
# PaperMC API v2 docs : https://papermc.io/api/docs/swagger-ui/index.html?configUrl=/api/openapi/swagger-config
|
||||
|
||||
build=${PAPERBUILD:=$(curl -fsSL "https://papermc.io/api/v2/projects/paper/versions/${VANILLA_VERSION}" -H "accept: application/json" \
|
||||
| jq '.builds[-1]')}
|
||||
build=$(curl -fsSL "https://papermc.io/api/v2/projects/paper/versions/${VANILLA_VERSION}" -H "accept: application/json" \
|
||||
| jq '.builds[-1]')
|
||||
case $? in
|
||||
0)
|
||||
;;
|
||||
@@ -28,7 +28,7 @@ else
|
||||
VANILLA_VERSION=$(echo "$versions" | jq -r '.versions[-1]')
|
||||
log "WARN: using ${VANILLA_VERSION} since that's the latest provided by PaperMC"
|
||||
# re-execute the current script with the newly computed version
|
||||
exec "$0" "$@"
|
||||
exec $0 "$@"
|
||||
fi
|
||||
log "ERROR: ${VANILLA_VERSION} is not published by PaperMC"
|
||||
log " Set VERSION to one of the following: "
|
||||
@@ -56,10 +56,6 @@ else
|
||||
zarg=(-z "$SERVER")
|
||||
fi
|
||||
|
||||
log "Removing old PaperMC versions ..."
|
||||
paperJarSearchString=${SERVER/$build/[0-9]*}
|
||||
find . -maxdepth 1 -name "$paperJarSearchString" ! -name "$SERVER" -delete -print
|
||||
|
||||
log "Downloading PaperMC $VANILLA_VERSION (build $build) ..."
|
||||
curl -fsSL -o "$SERVER" "${zarg[@]}" \
|
||||
"https://papermc.io/api/v2/projects/paper/versions/${VANILLA_VERSION}/builds/${build}/downloads/${SERVER}" \
|
||||
@@ -75,4 +71,4 @@ export TYPE=SPIGOT
|
||||
export SKIP_LOG4J_CONFIG=true
|
||||
|
||||
# Continue to Final Setup
|
||||
exec ${SCRIPTS:-/}start-finalSetupWorld "$@"
|
||||
exec ${SCRIPTS:-/}start-finalSetupWorld $@
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
IFS=$'\n\t'
|
||||
|
||||
. ${SCRIPTS:-/}start-utils
|
||||
isDebugging && set -x
|
||||
|
||||
: ${VANILLA_VERSION:?}
|
||||
: ${PURPUR_BUILD:=LATEST}
|
||||
: ${FORCE_REDOWNLOAD:=false}
|
||||
|
||||
if [[ ${PURPUR_BUILD} == LATEST ]]; then
|
||||
PURPUR_BUILD=$(curl -fsSL "https://purpur.pl3x.net/api/v1/purpur/${VANILLA_VERSION}" |
|
||||
jq -r '.builds.latest' || echo "")
|
||||
if [[ -z ${PURPUR_BUILD} ]]; then
|
||||
log "ERROR: Failed to locate a Purpur build for ${VANILLA_VERSION}."
|
||||
log " Please check if a download is available at https://purpur.pl3x.net/downloads/"
|
||||
exit 3
|
||||
fi
|
||||
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"
|
||||
log "Downloading Purpur from $downloadUrl ..."
|
||||
if ! curl -fsSL -o "$SERVER" "$downloadUrl"; then
|
||||
log "ERROR: failed to download from $downloadUrl (status=$?)"
|
||||
exit 3
|
||||
fi
|
||||
fi
|
||||
|
||||
# Normalize on Spigot for later operations
|
||||
export TYPE=SPIGOT
|
||||
export SKIP_LOG4J_CONFIG=true
|
||||
|
||||
# Continue to Final Setup
|
||||
exec ${SCRIPTS:-/}start-finalSetupWorld $@
|
||||
@@ -3,8 +3,6 @@
|
||||
. ${SCRIPTS:-/}start-utils
|
||||
|
||||
export TYPE=spongevanilla
|
||||
: ${SPONGEBRANCH:=STABLE}
|
||||
: ${SPONGEVERSION:=}
|
||||
|
||||
# Parse branch
|
||||
log "Choosing branch for Sponge"
|
||||
|
||||
@@ -20,7 +20,7 @@ if [ ! -f "$SERVER" ] || [ -n "$FORCE_REDOWNLOAD" ]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
# Normalize on Spigot for later operations
|
||||
# Normalize on Spigot for operations below
|
||||
export TYPE=SPIGOT
|
||||
|
||||
# Continue to Final Setup
|
||||
|
||||
@@ -24,4 +24,4 @@ case "X$MODCONFIG" in
|
||||
esac
|
||||
fi
|
||||
|
||||
exec ${SCRIPTS:-/}start-finalSetupMounts $@
|
||||
exec ${SCRIPTS:-/}start-finalSetupPlugins $@
|
||||
|
||||
@@ -19,13 +19,8 @@ if isTrue ${REMOVE_OLD_MODS}; then
|
||||
;;
|
||||
esac
|
||||
|
||||
# only try to remove existing mods dir
|
||||
if [ -d "$remove_mods_dest" ]; then
|
||||
log "Removing old mods in $remove_mods_dest..."
|
||||
find $remove_mods_dest -mindepth 1 -maxdepth ${REMOVE_OLD_MODS_DEPTH:-16} -wholename "${REMOVE_OLD_MODS_INCLUDE:-*}" -not -wholename "${REMOVE_OLD_MODS_EXCLUDE}" -delete
|
||||
else
|
||||
log "Directory $remove_mods_dest does not exist; removing nothing."
|
||||
fi
|
||||
log "Removing old mods in $remove_mods_dest..."
|
||||
find $remove_mods_dest -mindepth 1 -maxdepth ${REMOVE_OLD_MODS_DEPTH:-16} -wholename "${REMOVE_OLD_MODS_INCLUDE:-*}" -not -wholename "${REMOVE_OLD_MODS_EXCLUDE}" -delete
|
||||
fi
|
||||
|
||||
# If supplied with a URL for a modpack (simple zip of jars), download it and unpack
|
||||
@@ -81,23 +76,16 @@ if [[ "$MODS" ]]; then
|
||||
do
|
||||
if isURL $i; then
|
||||
log "Downloading mod/plugin $i ..."
|
||||
if isValidFileURL jar "$i"; then
|
||||
if ! curl -fsSL -o "${out_dir}/$(getFilenameFromUrl "${i}")" "${i}"; then
|
||||
effective_url=$(resolveEffectiveUrl "$i")
|
||||
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
|
||||
effective_url=$(resolveEffectiveUrl "$i")
|
||||
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
|
||||
log "ERROR: $effective_url resolved from $i is not a valid jar URL"
|
||||
exit 2
|
||||
fi
|
||||
else
|
||||
log "ERROR Invalid URL given in MODS: $i"
|
||||
@@ -160,8 +148,7 @@ if [[ "${GENERIC_PACK}" ]]; then
|
||||
if ! sha256sum -c ${sum_file} -s 2> /dev/null; then
|
||||
base_dir=/tmp/generic_pack_base
|
||||
mkdir -p ${base_dir}
|
||||
isDebugging && ls -l "${GENERIC_PACK}"
|
||||
unzip -q -d ${base_dir} "${GENERIC_PACK}"
|
||||
unzip -q -d ${base_dir} ${GENERIC_PACK}
|
||||
if [ -f /data/manifest.txt ]; then
|
||||
log "Manifest exists from older generic pack, cleaning up ..."
|
||||
while read f; do
|
||||
@@ -179,7 +166,7 @@ if [[ "${GENERIC_PACK}" ]]; then
|
||||
for d in $(find ${base_dir} -type d); do mkdir -p "$(sed "s#${base_dir}#/data#" <<< $d)"; done
|
||||
for f in $(find ${base_dir} -type f); do cp -f "$f" "$(sed "s#${base_dir}#/data#" <<< $f)"; done
|
||||
rm -rf ${base_dir}
|
||||
sha256sum "${GENERIC_PACK}" > ${sum_file}
|
||||
sha256sum ${GENERIC_PACK} > ${sum_file}
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
. ${SCRIPTS:-/}start-utils
|
||||
|
||||
: ${PLUGINS_SYNC_UPDATE:=true}
|
||||
|
||||
isDebugging && set -x
|
||||
|
||||
if [ -d /plugins ]; then
|
||||
case ${TYPE} in
|
||||
SPIGOT|BUKKIT|PAPER|MAGMA)
|
||||
mkdir -p /data/plugins
|
||||
log "Copying plugins over..."
|
||||
if isTrue ${PLUGINS_SYNC_UPDATE}; then
|
||||
updateArg="--update"
|
||||
fi
|
||||
# Copy plugins over using rsync to allow deeply nested updates of plugins
|
||||
rsync -a --out-format="update:%f:Last Modified %M" --prune-empty-dirs $updateArg /plugins /data
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
# If any modules have been provided, copy them over
|
||||
if [ -d /mods ]; then
|
||||
log "Copying any mods over..."
|
||||
mkdir -p /data/mods
|
||||
rsync -a --out-format="update:%f:Last Modified %M" "${rsyncArgs[@]}" --prune-empty-dirs --update /mods /data
|
||||
fi
|
||||
|
||||
: ${COPY_CONFIG_DEST:="/data/config"}
|
||||
|
||||
if [ -d /config ]; then
|
||||
log "Copying any configs from /config to $COPY_CONFIG_DEST"
|
||||
mkdir -p $COPY_CONFIG_DEST
|
||||
rsync -a --out-format="update:%f:Last Modified %M" "${rsyncArgs[@]}" --prune-empty-dirs --update /config/ $COPY_CONFIG_DEST
|
||||
fi
|
||||
|
||||
exec ${SCRIPTS:-/}start-finalSetupServerProperties $@
|
||||
23
start-finalSetupPlugins
Executable file
23
start-finalSetupPlugins
Executable file
@@ -0,0 +1,23 @@
|
||||
#!/bin/bash
|
||||
|
||||
. ${SCRIPTS:-/}start-utils
|
||||
|
||||
: ${PLUGINS_SYNC_UPDATE:=true}
|
||||
|
||||
isDebugging && set -x
|
||||
|
||||
if [ -d /plugins ]; then
|
||||
case ${TYPE} in
|
||||
SPIGOT|BUKKIT|PAPER)
|
||||
mkdir -p /data/plugins
|
||||
log "Copying plugins over..."
|
||||
if isTrue ${PLUGINS_SYNC_UPDATE}; then
|
||||
updateArg="--update"
|
||||
fi
|
||||
# Copy plugins over using rsync to allow deeply nested updates of plugins
|
||||
rsync -a --out-format="update:%f:Last Modified %M" --prune-empty-dirs $updateArg /plugins /data
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
exec ${SCRIPTS:-/}start-finalSetupServerProperties $@
|
||||
@@ -13,7 +13,7 @@ function setServerProp {
|
||||
var=${var,,} ;;
|
||||
esac
|
||||
log "Setting ${prop} to '${var}' in ${SERVER_PROPERTIES}"
|
||||
sed -i "/^${prop}\s*=/ c ${prop}=${var//\\/\\\\}" "$SERVER_PROPERTIES"
|
||||
sed -i "/^${prop}\s*=/ c ${prop}=${var}" "$SERVER_PROPERTIES"
|
||||
else
|
||||
log "Skip setting ${prop}"
|
||||
fi
|
||||
@@ -69,7 +69,7 @@ function customizeServerProps {
|
||||
setServerProp "max-world-size" "$MAX_WORLD_SIZE"
|
||||
setServerProp "level-name" "$LEVEL"
|
||||
setServerProp "level-seed" "$SEED"
|
||||
setServerProp "pvp" "${PVP}"
|
||||
setServerProp "pvp" "$PVP"
|
||||
setServerProp "generator-settings" "$GENERATOR_SETTINGS"
|
||||
setServerProp "online-mode" "$ONLINE_MODE"
|
||||
setServerProp "allow-flight" "$ALLOW_FLIGHT"
|
||||
|
||||
@@ -4,9 +4,6 @@
|
||||
set -e
|
||||
isDebugging && set -x
|
||||
|
||||
: ${LEVEL:=world}
|
||||
export LEVEL
|
||||
|
||||
if [ $TYPE = "FEED-THE-BEAST" ]; then
|
||||
worldDest=$FTB_DIR/$LEVEL
|
||||
else
|
||||
|
||||
@@ -2,41 +2,31 @@
|
||||
|
||||
. ${SCRIPTS:-/}start-utils
|
||||
|
||||
if [ -n "$OPS" ]; then
|
||||
log "Updating ops"
|
||||
rm -f /data/ops.txt.converted
|
||||
echo $OPS | awk -v RS=, '{print}' > /data/ops.txt
|
||||
: ${COPY_CONFIG_DEST:="/data/config"}
|
||||
|
||||
if isTrue "${OVERRIDE_OPS}"; then
|
||||
log "Recreating ops.json file at server startup"
|
||||
rm -f /data/ops.json
|
||||
fi
|
||||
if [ -n "$OPS" ]; then
|
||||
log "Setting/adding ops"
|
||||
rm -rf /data/ops.txt.converted
|
||||
echo $OPS | awk -v RS=, '{print}' > /data/ops.txt
|
||||
fi
|
||||
|
||||
if [ -n "$WHITELIST" ]; then
|
||||
log "Updating whitelist"
|
||||
rm -f /data/white-list.txt.converted
|
||||
log "Setting whitelist"
|
||||
rm -rf /data/white-list.txt.converted
|
||||
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
|
||||
|
||||
if [ -n "$ICON" ]; then
|
||||
if [ ! -e server-icon.png ] || [ "${OVERRIDE_ICON}" == "TRUE" ]; then
|
||||
log "Using server icon from $ICON..."
|
||||
# Not sure what it is yet...call it "img"
|
||||
curl -sSL -o /tmp/icon.img $ICON
|
||||
specs=$(identify /tmp/icon.img | awk '{print $2,$3}')
|
||||
if [ "$specs" = "PNG 64x64" ]; then
|
||||
mv /tmp/icon.img /data/server-icon.png
|
||||
else
|
||||
log "Converting image to 64x64 PNG..."
|
||||
convert /tmp/icon.img -resize 64x64! /data/server-icon.png
|
||||
fi
|
||||
fi
|
||||
if [ -n "$ICON" -a ! -e server-icon.png ]; then
|
||||
log "Using server icon from $ICON..."
|
||||
# Not sure what it is yet...call it "img"
|
||||
curl -sSL -o /tmp/icon.img $ICON
|
||||
specs=$(identify /tmp/icon.img | awk '{print $2,$3}')
|
||||
if [ "$specs" = "PNG 64x64" ]; then
|
||||
mv /tmp/icon.img /data/server-icon.png
|
||||
else
|
||||
log "Converting image to 64x64 PNG..."
|
||||
convert /tmp/icon.img -resize 64x64! /data/server-icon.png
|
||||
fi
|
||||
fi
|
||||
|
||||
if ! isTrue ${SKIP_LOG4J_CONFIG}; then
|
||||
@@ -61,6 +51,20 @@ for j in $JSON_FILES; do
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
# If any modules have been provided, copy them over
|
||||
if [ -d /mods ]; then
|
||||
log "Copying any mods over..."
|
||||
mkdir -p /data/mods
|
||||
rsync -a --out-format="update:%f:Last Modified %M" "${rsyncArgs[@]}" --prune-empty-dirs --update /mods /data
|
||||
fi
|
||||
|
||||
if [ -d /config ]; then
|
||||
log "Copying any configs from /config to $COPY_CONFIG_DEST"
|
||||
mkdir -p $COPY_CONFIG_DEST
|
||||
rsync -a --out-format="update:%f:Last Modified %M" "${rsyncArgs[@]}" --prune-empty-dirs --update /config/ $COPY_CONFIG_DEST
|
||||
fi
|
||||
|
||||
EXTRA_ARGS=""
|
||||
# Optional disable console
|
||||
if versionLessThan 1.14 && [[ ${CONSOLE,,} = false ]]; then
|
||||
@@ -83,6 +87,23 @@ if [ -n "$JVM_DD_OPTS" ]; then
|
||||
done
|
||||
fi
|
||||
|
||||
if isTrue ${TUNE_VIRTUALIZED}; then
|
||||
JVM_XX_OPTS="${JVM_XX_OPTS} -Xtune:virtualized"
|
||||
fi
|
||||
|
||||
if isTrue ${TUNE_NURSERY_SIZES}; then
|
||||
case ${MAX_MEMORY^^} in
|
||||
*G)
|
||||
MAX_MEMORY_MB=$(( ${MAX_MEMORY%?} * 1024 )) ;;
|
||||
*M)
|
||||
MAX_MEMORY_MB=${MAX_MEMORY%?} ;;
|
||||
esac
|
||||
|
||||
NURSERY_MINIMUM=$(( ${MAX_MEMORY_MB} / 2 ))
|
||||
NURSERY_MAXIMUM=$(( ${MAX_MEMORY_MB} * 4/5 ))
|
||||
JVM_XX_OPTS="${JVM_XX_OPTS} -Xmns${NURSERY_MINIMUM}M -Xmnx${NURSERY_MAXIMUM}M"
|
||||
fi
|
||||
|
||||
if isTrue ${ENABLE_JMX}; then
|
||||
: ${JMX_HOST:=0.0.0.0}
|
||||
: ${JMX_PORT:=7091}
|
||||
@@ -158,11 +179,11 @@ JVM_OPTS="-Xms${INIT_MEMORY} -Xmx${MAX_MEMORY} ${JVM_OPTS}"
|
||||
function copyFilesForCurseForge() {
|
||||
# copy player modification files unconditionally since their
|
||||
# processing into json is additive anyway
|
||||
[ -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/ops.txt ] && cp -f /data/ops.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
|
||||
cp -f /data/server-icon.png "${FTB_DIR}/"
|
||||
cp -f /data/server-icon.png ${FTB_DIR}/
|
||||
fi
|
||||
|
||||
cp -f /data/eula.txt "${FTB_DIR}/"
|
||||
@@ -176,7 +197,7 @@ if [[ ${TYPE} == "CURSE_INSTANCE" ]]; then
|
||||
exec mc-server-runner ${mcServerRunnerArgs} \
|
||||
--cf-instance-file "${CURSE_INSTANCE_JSON}" \
|
||||
java $JVM_XX_OPTS $JVM_OPTS $expandedDOpts -jar _SERVERJAR_ "$@" $EXTRA_ARGS
|
||||
elif [[ ${TYPE} == "CURSEFORGE" && "${SERVER}" ]]; then
|
||||
elif [[ ${TYPE} == "FEED-THE-BEAST" && "${SERVER}" ]]; then
|
||||
copyFilesForCurseForge
|
||||
|
||||
cd "${FTB_DIR}"
|
||||
@@ -185,7 +206,7 @@ elif [[ ${TYPE} == "CURSEFORGE" && "${SERVER}" ]]; then
|
||||
set -x
|
||||
fi
|
||||
exec mc-server-runner ${bootstrapArgs} ${mcServerRunnerArgs} java $JVM_XX_OPTS $JVM_OPTS $expandedDOpts -jar $(basename "${SERVER}") "$@" $EXTRA_ARGS
|
||||
elif [[ ${TYPE} == "CURSEFORGE" ]]; then
|
||||
elif [[ ${TYPE} == "FEED-THE-BEAST" ]]; then
|
||||
mcServerRunnerArgs="${mcServerRunnerArgs} --shell bash"
|
||||
|
||||
copyFilesForCurseForge
|
||||
|
||||
@@ -145,8 +145,7 @@ requireVar() {
|
||||
}
|
||||
|
||||
function writeEula() {
|
||||
if ! echo "# Generated via Docker
|
||||
# $(date)
|
||||
if ! echo "# Generated via Docker on $(date)
|
||||
eula=${EULA,,}
|
||||
" >/data/eula.txt; then
|
||||
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