mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2026-02-17 15:13:55 +00:00
Compare commits
1 Commits
2021.19.0-
...
java7
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a94af56566 |
5
.github/workflows/build-multiarch.yml
vendored
5
.github/workflows/build-multiarch.yml
vendored
@@ -5,6 +5,7 @@ on:
|
|||||||
- master
|
- master
|
||||||
- "*-multiarch"
|
- "*-multiarch"
|
||||||
- "multiarch*"
|
- "multiarch*"
|
||||||
|
- java7
|
||||||
- java8-openj9
|
- java8-openj9
|
||||||
- java11*
|
- java11*
|
||||||
- java16*
|
- java16*
|
||||||
@@ -63,10 +64,10 @@ jobs:
|
|||||||
|
|
||||||
- name: Build and push
|
- name: Build and push
|
||||||
id: docker_build
|
id: docker_build
|
||||||
uses: docker/build-push-action@v2.7.0
|
uses: docker/build-push-action@v2.6.1
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
platforms: linux/amd64,linux/arm/v7,linux/arm64
|
platforms: linux/amd64,linux/arm/v7
|
||||||
push: ${{ github.event_name != 'pull_request' }}
|
push: ${{ github.event_name != 'pull_request' }}
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
# ensure latest base image is used
|
# ensure latest base image is used
|
||||||
|
|||||||
2
.github/workflows/main.yml
vendored
2
.github/workflows/main.yml
vendored
@@ -70,7 +70,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Build and push
|
- name: Build and push
|
||||||
id: docker_build
|
id: docker_build
|
||||||
uses: docker/build-push-action@v2.7.0
|
uses: docker/build-push-action@v2.6.1
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
file: ./Dockerfile
|
file: ./Dockerfile
|
||||||
|
|||||||
41
Dockerfile
41
Dockerfile
@@ -1,4 +1,4 @@
|
|||||||
FROM adoptopenjdk:8-jre-hotspot
|
FROM openjdk:7-jre
|
||||||
|
|
||||||
LABEL org.opencontainers.image.authors="Geoff Bourne <itzgeoff@gmail.com>"
|
LABEL org.opencontainers.image.authors="Geoff Bourne <itzgeoff@gmail.com>"
|
||||||
|
|
||||||
@@ -6,7 +6,6 @@ RUN apt-get update \
|
|||||||
&& DEBIAN_FRONTEND=noninteractive \
|
&& DEBIAN_FRONTEND=noninteractive \
|
||||||
apt-get install -y \
|
apt-get install -y \
|
||||||
imagemagick \
|
imagemagick \
|
||||||
gosu \
|
|
||||||
sudo \
|
sudo \
|
||||||
net-tools \
|
net-tools \
|
||||||
curl wget \
|
curl wget \
|
||||||
@@ -22,6 +21,42 @@ RUN apt-get update \
|
|||||||
ttf-dejavu \
|
ttf-dejavu \
|
||||||
&& apt-get clean
|
&& apt-get clean
|
||||||
|
|
||||||
|
# Procedure from https://github.com/tianon/gosu/blob/master/INSTALL.md#from-debian
|
||||||
|
ENV GOSU_VERSION 1.14
|
||||||
|
RUN set -eux; \
|
||||||
|
# save list of currently installed packages for later so we can clean up
|
||||||
|
savedAptMark="$(apt-mark showmanual)"; \
|
||||||
|
apt-get update; \
|
||||||
|
apt-get install -y --no-install-recommends ca-certificates wget; \
|
||||||
|
if ! command -v gpg; then \
|
||||||
|
apt-get install -y --no-install-recommends gnupg2 dirmngr; \
|
||||||
|
elif gpg --version | grep -q '^gpg (GnuPG) 1\.'; then \
|
||||||
|
# "This package provides support for HKPS keyservers." (GnuPG 1.x only)
|
||||||
|
apt-get install -y --no-install-recommends gnupg-curl; \
|
||||||
|
fi; \
|
||||||
|
rm -rf /var/lib/apt/lists/*; \
|
||||||
|
\
|
||||||
|
dpkgArch="$(dpkg --print-architecture | awk -F- '{ print $NF }')"; \
|
||||||
|
wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch"; \
|
||||||
|
wget -O /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch.asc"; \
|
||||||
|
\
|
||||||
|
# verify the signature
|
||||||
|
export GNUPGHOME="$(mktemp -d)"; \
|
||||||
|
gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4; \
|
||||||
|
gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu; \
|
||||||
|
command -v gpgconf && gpgconf --kill all || :; \
|
||||||
|
rm -rf "$GNUPGHOME" /usr/local/bin/gosu.asc; \
|
||||||
|
\
|
||||||
|
# clean up fetch dependencies
|
||||||
|
apt-mark auto '.*' > /dev/null; \
|
||||||
|
[ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \
|
||||||
|
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
|
||||||
|
\
|
||||||
|
chmod +x /usr/local/bin/gosu; \
|
||||||
|
# verify that the binary works
|
||||||
|
gosu --version; \
|
||||||
|
gosu nobody true
|
||||||
|
|
||||||
RUN addgroup --gid 1000 minecraft \
|
RUN addgroup --gid 1000 minecraft \
|
||||||
&& adduser --system --shell /bin/false --uid 1000 --ingroup minecraft --home /data minecraft
|
&& adduser --system --shell /bin/false --uid 1000 --ingroup minecraft --home /data minecraft
|
||||||
|
|
||||||
@@ -52,7 +87,7 @@ RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
|
|||||||
--from https://github.com/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
|
--from https://github.com/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
|
||||||
|
|
||||||
RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
|
RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
|
||||||
--var version=1.7.0 --var app=mc-server-runner --file {{.app}} \
|
--var version=1.6.0 --var app=mc-server-runner --file {{.app}} \
|
||||||
--from https://github.com/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
|
--from https://github.com/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
|
||||||
|
|
||||||
RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
|
RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
|
||||||
|
|||||||
15
README.md
15
README.md
@@ -38,7 +38,6 @@ By default, the container will download the latest version of the "vanilla" [Min
|
|||||||
* [Examples](#examples)
|
* [Examples](#examples)
|
||||||
* [Amazon Web Services (AWS) Deployment](#amazon-web-services-aws-deployment)
|
* [Amazon Web Services (AWS) Deployment](#amazon-web-services-aws-deployment)
|
||||||
* [Using Docker Compose](#using-docker-compose)
|
* [Using Docker Compose](#using-docker-compose)
|
||||||
* [Troubleshooting](#troubleshooting)
|
|
||||||
* [Server types](#server-types)
|
* [Server types](#server-types)
|
||||||
* [Running a Forge Server](#running-a-forge-server)
|
* [Running a Forge Server](#running-a-forge-server)
|
||||||
* [Running a Bukkit/Spigot server](#running-a-bukkitspigot-server)
|
* [Running a Bukkit/Spigot server](#running-a-bukkitspigot-server)
|
||||||
@@ -129,7 +128,7 @@ By default, the container will download the latest version of the "vanilla" [Min
|
|||||||
* [Enabling Autopause](#enabling-autopause)
|
* [Enabling Autopause](#enabling-autopause)
|
||||||
* [Running on RaspberryPi](#running-on-raspberrypi)
|
* [Running on RaspberryPi](#running-on-raspberrypi)
|
||||||
|
|
||||||
<!-- Added by: runner, at: Sun Aug 29 21:26:46 UTC 2021 -->
|
<!-- Added by: runner, at: Sun Aug 15 17:44:45 UTC 2021 -->
|
||||||
|
|
||||||
<!--te-->
|
<!--te-->
|
||||||
|
|
||||||
@@ -351,14 +350,6 @@ and in the same directory as that file run
|
|||||||
Now, go play...or adjust the `environment` section to configure
|
Now, go play...or adjust the `environment` section to configure
|
||||||
this server instance.
|
this server instance.
|
||||||
|
|
||||||
## Troubleshooting
|
|
||||||
|
|
||||||
To troubleshoot the container initialization, such as when server files are pre-downloaded, set the environment variable `DEBUG` to `true`. The container logs will include **much more** output, and it is highly recommended including that output when reporting any [issues](https://github.com/itzg/docker-minecraft-server/issues).
|
|
||||||
|
|
||||||
To troubleshoot just the command-line used to start the Minecraft server, set the environment variable `DEBUG_EXEC` to `true`.
|
|
||||||
|
|
||||||
To troubleshoot any issues with memory allocation reported by the JVM, set the environment variable `DEBUG_MEMORY` to `true`.
|
|
||||||
|
|
||||||
## Server types
|
## Server types
|
||||||
|
|
||||||
### Running a Forge Server
|
### Running a Forge Server
|
||||||
@@ -1009,10 +1000,6 @@ For example (just the `-e` bits):
|
|||||||
|
|
||||||
-e LEVEL_TYPE=flat -e 'GENERATOR_SETTINGS=3;minecraft:bedrock,3*minecraft:stone,52*minecraft:sandstone;2;'
|
-e LEVEL_TYPE=flat -e 'GENERATOR_SETTINGS=3;minecraft:bedrock,3*minecraft:stone,52*minecraft:sandstone;2;'
|
||||||
|
|
||||||
In Minecraft 1.13+ you need to pass json ([generator site](https://misode.github.io/world/)) like this (details see [here](https://github.com/itzg/docker-minecraft-server/issues/999#issuecomment-907849644)):
|
|
||||||
|
|
||||||
-e LEVEL_TYPE=flat -e 'GENERATOR_SETTINGS={"biome":"minecraft:the_void","layers":[{"block":"minecraft:bedrock","height":1},{"block":"minecraft:stone","height":10},{"block":"minecraft:dirt","height":1}],"structures":{"structures":{}}}'
|
|
||||||
|
|
||||||
### Custom Server Resource Pack
|
### Custom Server Resource Pack
|
||||||
|
|
||||||
You can set a link to a custom resource pack and set it's checksum using the `RESOURCE_PACK` and `RESOURCE_PACK_SHA1` options respectively, the default is blank:
|
You can set a link to a custom resource pack and set it's checksum using the `RESOURCE_PACK` and `RESOURCE_PACK_SHA1` options respectively, the default is blank:
|
||||||
|
|||||||
@@ -98,6 +98,14 @@ case "${TYPE^^}" in
|
|||||||
;;
|
;;
|
||||||
|
|
||||||
FORGE)
|
FORGE)
|
||||||
|
if versionLessThan 1.17; then
|
||||||
|
log "**********************************************************************"
|
||||||
|
log "WARNING: The image tag itzg/minecraft-server:java8 is recommended"
|
||||||
|
log " since some mods require Java 8"
|
||||||
|
log " Exception traces reporting ClassCastException: class jdk.internal.loader.ClassLoaders\$AppClassLoader"
|
||||||
|
log " can be fixed with java8"
|
||||||
|
log "**********************************************************************"
|
||||||
|
fi
|
||||||
exec ${SCRIPTS:-/}start-deployForge "$@"
|
exec ${SCRIPTS:-/}start-deployForge "$@"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
@@ -110,6 +118,12 @@ case "${TYPE^^}" in
|
|||||||
;;
|
;;
|
||||||
|
|
||||||
FTB|CURSEFORGE)
|
FTB|CURSEFORGE)
|
||||||
|
log "**********************************************************************"
|
||||||
|
log "WARNING: The image tag itzg/minecraft-server:java8 is recommended"
|
||||||
|
log " since some mods require Java 8"
|
||||||
|
log " Exception traces reporting ClassCastException: class jdk.internal.loader.ClassLoaders\$AppClassLoader"
|
||||||
|
log " can be fixed with java8"
|
||||||
|
log "**********************************************************************"
|
||||||
exec ${SCRIPTS:-/}start-deployCF "$@"
|
exec ${SCRIPTS:-/}start-deployCF "$@"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
|||||||
@@ -9,10 +9,6 @@ isDebugging && set -x
|
|||||||
: ${FORCE_REDOWNLOAD:=false}
|
: ${FORCE_REDOWNLOAD:=false}
|
||||||
: ${LIMBO_SCHEMA_FILENAME:=default.schem}
|
: ${LIMBO_SCHEMA_FILENAME:=default.schem}
|
||||||
: ${LEVEL:=Default;${LIMBO_SCHEMA_FILENAME}}
|
: ${LEVEL:=Default;${LIMBO_SCHEMA_FILENAME}}
|
||||||
# defaults to localhost, if this is not set
|
|
||||||
: ${SERVER_IP:=0.0.0.0}
|
|
||||||
|
|
||||||
export LEVEL SERVER_IP
|
|
||||||
|
|
||||||
if [[ ${LIMBO_BUILD^^} == LATEST ]]; then
|
if [[ ${LIMBO_BUILD^^} == LATEST ]]; then
|
||||||
LIMBO_BUILD=lastStableBuild
|
LIMBO_BUILD=lastStableBuild
|
||||||
@@ -26,14 +22,11 @@ if [ $? != 0 ]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ ${LIMBO_BUILD} = lastStableBuild ]]; then
|
PURPUR_BUILD=$(jq -r '.number' <<<${buildJson})
|
||||||
LIMBO_BUILD=$(jq -r '.number' <<<${buildJson})
|
|
||||||
log "Resolved latest Limbo build to ${LIMBO_BUILD}"
|
|
||||||
fi
|
|
||||||
artifactPath=$(jq -r '.artifacts[] | select(.fileName|test("^Limbo-")) | .relativePath' <<<${buildJson})
|
artifactPath=$(jq -r '.artifacts[] | select(.fileName|test("^Limbo-")) | .relativePath' <<<${buildJson})
|
||||||
defaultSchemaPath=$(jq -r '.artifacts[] | select(.fileName|test(".*\\.schem")) | .relativePath' <<<${buildJson})
|
defaultSchemaPath=$(jq -r '.artifacts[] | select(.fileName|test(".*\\.schem")) | .relativePath' <<<${buildJson})
|
||||||
|
|
||||||
export SERVER="limbo-${LIMBO_BUILD}.jar"
|
export SERVER="purpur-${PURPUR_BUILD}.jar"
|
||||||
|
|
||||||
if [ ! -f "$SERVER" ] || isTrue "$FORCE_REDOWNLOAD"; then
|
if [ ! -f "$SERVER" ] || isTrue "$FORCE_REDOWNLOAD"; then
|
||||||
downloadUrl="${baseUrl}/artifact/${artifactPath}"
|
downloadUrl="${baseUrl}/artifact/${artifactPath}"
|
||||||
@@ -53,7 +46,7 @@ if [ ! -f "${LIMBO_SCHEMA_FILENAME}" ]; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ ${LEVEL} != *\;* ]]; then
|
if [[ ${LEVEL} != "*;*" ]]; then
|
||||||
LEVEL="${LEVEL};${LIMBO_SCHEMA_FILENAME}"
|
LEVEL="${LEVEL};${LIMBO_SCHEMA_FILENAME}"
|
||||||
fi
|
fi
|
||||||
export LEVEL
|
export LEVEL
|
||||||
|
|||||||
@@ -154,10 +154,7 @@ fi
|
|||||||
if [[ "${GENERIC_PACK}" ]]; then
|
if [[ "${GENERIC_PACK}" ]]; then
|
||||||
if isURL "${GENERIC_PACK}"; then
|
if isURL "${GENERIC_PACK}"; then
|
||||||
log "Downloading generic pack ..."
|
log "Downloading generic pack ..."
|
||||||
if ! curl -fsSL -o /tmp/generic_pack.zip "${GENERIC_PACK}"; then
|
curl -fsSL -o /tmp/generic_pack.zip "${GENERIC_PACK}"
|
||||||
log "ERROR: failed to download ${GENERIC_PACK}"
|
|
||||||
exit 2
|
|
||||||
fi
|
|
||||||
GENERIC_PACK=/tmp/generic_pack.zip
|
GENERIC_PACK=/tmp/generic_pack.zip
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user