From 690598da601ddd3c71bb17e9822ad3bc066ae82b Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Tue, 4 Feb 2020 20:10:45 -0600 Subject: [PATCH 01/54] Try BuildKit/multiarch support on CircleCI --- .circleci/config.yml | 22 ++++++++++------------ Dockerfile | 32 ++++++++++++++++++++++---------- 2 files changed, 32 insertions(+), 22 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 42b4466d..cceae470 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,17 +1,15 @@ -version: 2 -jobs: - minecraft_server: - docker: - - image: circleci/buildpack-deps:19.10 - steps: - - checkout - - setup_remote_docker - - run: - name: Build image - command: docker build -t mc:$CIRCLE_BUILD_NUM . +version: 2.1 + +orbs: + docker: circleci/docker@0.5.20 workflows: version: 2 build: jobs: - - minecraft_server + - docker/publish: + image: $CIRCLE_PROJECT_USERNAME/minecraft-server + tag: multiarch + extra_build_args: "--platform linux/amd64,linux/arm64,linux/arm/v7" + deploy: false + diff --git a/Dockerfile b/Dockerfile index 3fb2e4b1..6fe2aaed 100644 --- a/Dockerfile +++ b/Dockerfile @@ -26,23 +26,35 @@ RUN addgroup -g 1000 minecraft \ EXPOSE 25565 25575 -# hook into docker buildx --platform support -# see https://github.com/docker/buildx/#---platformvaluevalue -ARG TARGETPLATFORM=linux/amd64 +# 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 EASY_ADD_VER=0.5.1 -ADD "https://easy-add-downloader.now.sh/api/download?version=${EASY_ADD_VER}&platform=${TARGETPLATFORM}" /usr/bin/easy-add +ARG EASY_ADD_VER=0.5.3 +ADD https://github.com/itzg/easy-add/releases/download/${EASY_ADD_VER}/easy-add_${TARGETOS}_${TARGETARCH}${TARGETVARIANT} /usr/bin/easy-add RUN chmod +x /usr/bin/easy-add -RUN easy-add --var version=1.2.0 --var app=restify --file restify --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} \ + --var version=1.2.0 --var app=restify --file restify \ + --from https://github.com/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz -RUN easy-add --var version=1.4.7 --var app=rcon-cli --file rcon-cli --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} \ + --var version=1.4.7 --var app=rcon-cli--file rcon-cli \ + --from https://github.com/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz -RUN easy-add --var version=0.1.6 --var app=mc-monitor --file mc-monitor --from https://github.com/itzg/{{.app}}/releases/download/v{{.version}}/{{.app}}_{{.version}}_Linux_{{.arch}}.tar.gz +RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \ + --var version=0.1.6 --var app=mc-monitor --file mc-monitor \ + --from https://github.com/itzg/{{.app}}/releases/download/v{{.version}}/{{.app}}_{{.version}}_Linux_{{.arch}}.tar.gz -RUN easy-add --var version=1.3.3 --var app=mc-server-runner --file mc-server-runner --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} \ + --var version=1.3.3 --var app=mc-server-runner --file mc-server-runner \ + --from https://github.com/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz -RUN easy-add --var version=0.1.0 --var app=maven-metadata-release --file maven-metadata-release --from https://github.com/itzg/{{.app}}/releases/download/v{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz +RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \ + --var version=0.1.0 --var app=maven-metadata-release--file maven-metadata-release \ + --from https://github.com/itzg/{{.app}}/releases/download/v{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz COPY mcadmin.jq /usr/share COPY mcstatus /usr/local/bin From 22d68f5c7ca3a2deae497d15a4d05e9359f45a9a Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Tue, 4 Feb 2020 20:13:02 -0600 Subject: [PATCH 02/54] Enable use-remote-docker --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index cceae470..7b92c269 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -12,4 +12,5 @@ workflows: tag: multiarch extra_build_args: "--platform linux/amd64,linux/arm64,linux/arm/v7" deploy: false + use-remote-docker: true From e9e5af849fa859e102078b6bdbc2c237515c2896 Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Tue, 4 Feb 2020 20:14:32 -0600 Subject: [PATCH 03/54] Use docker executor --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7b92c269..071aa967 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -12,5 +12,6 @@ workflows: tag: multiarch extra_build_args: "--platform linux/amd64,linux/arm64,linux/arm/v7" deploy: false + executor: docker/docker use-remote-docker: true From f48741f65c02aedc880922935825954f13f0034f Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Wed, 5 Feb 2020 08:21:52 -0600 Subject: [PATCH 04/54] Try BuildKit via regular setup_remote_docker --- .circleci/config.yml | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 071aa967..30c4e1f4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,17 +1,20 @@ version: 2.1 -orbs: - docker: circleci/docker@0.5.20 +jobs: + build: + docker: + - image: docker:18.09.6 + environment: + DOCKER_BUILDKIT: "1" + steps: + - checkout + - setup_remote_docker: + version: 18.09.3 + - run: docker build --platform linux/amd64,linux/arm64,linux/arm/v7 -t itzg/minecraft-server:multiarch . workflows: version: 2 build: jobs: - - docker/publish: - image: $CIRCLE_PROJECT_USERNAME/minecraft-server - tag: multiarch - extra_build_args: "--platform linux/amd64,linux/arm64,linux/arm/v7" - deploy: false - executor: docker/docker - use-remote-docker: true + - build From 818539e3deb69bd14093fff2037f02297eede82c Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Wed, 5 Feb 2020 21:33:08 -0600 Subject: [PATCH 05/54] Switched base image to adoptopenjdk (debian) --- Dockerfile | 41 ++++++++++++++++++++++------------------- start | 2 +- 2 files changed, 23 insertions(+), 20 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6fe2aaed..2560aed1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,26 +1,29 @@ -FROM openjdk:8u212-jre-alpine +FROM adoptopenjdk:8-jre-hotspot LABEL maintainer "itzg" -RUN apk add --no-cache -U \ - openssl \ - imagemagick \ - lsof \ - su-exec \ - shadow \ - bash \ - curl iputils wget \ - git \ - jq \ - mysql-client \ - tzdata \ - rsync \ - nano +RUN apt-get update \ + && DEBIAN_FRONTEND=noninteractive \ + apt-get install -y \ + openssl \ + imagemagick \ + lsof \ + gosu \ + bash \ + curl wget \ + git \ + jq \ + dos2unix \ + mysql-client \ + tzdata \ + rsync \ + nano \ + && apt-get clean HEALTHCHECK --start-period=1m CMD mc-monitor status --host localhost --port $SERVER_PORT -RUN addgroup -g 1000 minecraft \ - && adduser -Ss /bin/false -u 1000 -G minecraft -h /home/minecraft minecraft \ +RUN addgroup --gid 1000 minecraft \ + && adduser --system --shell /bin/false --uid 1000 --ingroup minecraft --home /home/minecraft minecraft \ && mkdir -m 777 /data /mods /config /plugins \ && chown minecraft:minecraft /data /config /mods /plugins /home/minecraft @@ -41,7 +44,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 RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \ - --var version=1.4.7 --var app=rcon-cli--file rcon-cli \ + --var version=1.4.7 --var app=rcon-cli --file rcon-cli \ --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} \ @@ -53,7 +56,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 RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \ - --var version=0.1.0 --var app=maven-metadata-release--file maven-metadata-release \ + --var version=0.1.0 --var app=maven-metadata-release --file maven-metadata-release \ --from https://github.com/itzg/{{.app}}/releases/download/v{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz COPY mcadmin.jq /usr/share diff --git a/start b/start index 69ed3d53..9fbedd98 100644 --- a/start +++ b/start @@ -38,7 +38,7 @@ if [ $(id -u) = 0 ]; then echo 'hosts: files dns' > /etc/nsswitch.conf fi - exec su-exec ${runAsUser}:${runAsGroup} /start-configuration $@ + exec gosu ${runAsUser}:${runAsGroup} /start-configuration $@ else exec /start-configuration $@ fi From 0db8780ad9a69f9f3957015c655d16909b8c523d Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Wed, 25 Mar 2020 21:05:16 -0500 Subject: [PATCH 06/54] Changed base image to arm32v7/adoptopenjdk --- Dockerfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index e70a39fa..24bbb055 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM adoptopenjdk:8-jre-hotspot +FROM arm32v7/adoptopenjdk LABEL maintainer "itzg" @@ -31,9 +31,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=arm +ARG TARGETVARIANT=v7 ARG EASY_ADD_VER=0.7.0 ADD https://github.com/itzg/easy-add/releases/download/${EASY_ADD_VER}/easy-add_${TARGETOS}_${TARGETARCH}${TARGETVARIANT} /usr/bin/easy-add From 9c7c95cf4fa7581353b92d478908b0f4667e5bfb Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Sun, 3 May 2020 11:51:56 -0500 Subject: [PATCH 07/54] Pinned Java version at 11 --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index d443bb68..bcebd74c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM arm32v7/adoptopenjdk +FROM arm32v7/adoptopenjdk:11-jre-hotspot LABEL maintainer "itzg" From ec7d182d384957a548f45d4a8a4fb0709bb329ac Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Mon, 11 May 2020 18:49:52 -0500 Subject: [PATCH 08/54] Avoid touch since rpi mounts default to noatime --- Dockerfile | 7 +++---- start-configuration | 11 ++--------- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/Dockerfile b/Dockerfile index bcebd74c..909cdef9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,11 @@ -FROM arm32v7/adoptopenjdk:11-jre-hotspot +FROM ubuntu:20.04 LABEL maintainer "itzg" RUN apt-get update \ && DEBIAN_FRONTEND=noninteractive \ apt-get install -y \ + openjdk-8-jre \ openssl \ imagemagick \ lsof \ @@ -23,9 +24,7 @@ RUN apt-get update \ HEALTHCHECK --start-period=1m CMD mc-monitor status --host localhost --port $SERVER_PORT RUN addgroup --gid 1000 minecraft \ - && adduser --system --shell /bin/false --uid 1000 --ingroup minecraft --home /home/minecraft minecraft \ - && mkdir -m 777 /data \ - && chown minecraft:minecraft /data /home/minecraft + && adduser --system --shell /bin/false --uid 1000 --ingroup minecraft --home /data minecraft EXPOSE 25565 25575 diff --git a/start-configuration b/start-configuration index 0d6290c9..f91293b9 100644 --- a/start-configuration +++ b/start-configuration @@ -7,6 +7,8 @@ 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 EULA="${EULA,,}" if [ "$EULA" != "true" ]; then @@ -28,15 +30,6 @@ 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" From 48e09f42fc5d3a9e5fac741c5e22dde7791e31be Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Thu, 14 May 2020 20:09:12 -0500 Subject: [PATCH 09/54] Changed base ubuntu to 18.04 --- Dockerfile | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index 909cdef9..716b3f03 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,18 +1,14 @@ -FROM ubuntu:20.04 +FROM ubuntu:18.04 LABEL maintainer "itzg" RUN apt-get update \ && DEBIAN_FRONTEND=noninteractive \ apt-get install -y \ - openjdk-8-jre \ - openssl \ + openjdk-8-jre-headless \ imagemagick \ - lsof \ gosu \ - bash \ curl wget \ - git \ jq \ dos2unix \ mysql-client \ @@ -68,7 +64,7 @@ WORKDIR /data ENTRYPOINT [ "/start" ] 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 \ 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" \ From 9ec336283ff718150dc4dbf5d62def250c9e181e Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Thu, 21 May 2020 20:48:54 -0500 Subject: [PATCH 10/54] Updated to support multiarch/BuiltKit builds --- BUILDING.md | 5 +++++ Dockerfile | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 BUILDING.md diff --git a/BUILDING.md b/BUILDING.md new file mode 100644 index 00000000..d85990ef --- /dev/null +++ b/BUILDING.md @@ -0,0 +1,5 @@ +Ensure buildx/BuildKit support is enabled and run: + +``` +docker buildx build --platform=linux/arm64 --platform=linux/arm/v7 --platform=linux/amd64 --tag itzg/minecraft-server:multiarch --push +``` diff --git a/Dockerfile b/Dockerfile index 2ab19ad7..3e40abb0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -26,9 +26,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=linux -ARG TARGETARCH=arm -ARG TARGETVARIANT=v7 +ARG TARGETOS +ARG TARGETARCH +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 From aa42633ab2c4c924f468fbfc6c7a9a2b22cf5845 Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Sun, 31 May 2020 18:18:54 -0500 Subject: [PATCH 11/54] Added support for FTB application modpacks via modpacks.ch For #524 --- .circleci/config.yml | 24 ---- .github/workflows/build-multiarch.yml | 24 ++++ BUILDING.md | 2 +- Dockerfile | 1 + README.md | 84 ++++++------ docs/.gitkeep | 0 examples/docker-compose-curseforge.yml | 6 +- examples/modpacks/.gitignore | 1 + examples/modpacks/README.md | 3 + start-configuration | 6 +- start-deployCF | 133 +++++++++++++++++++ start-deployFTB | 173 ++++++++----------------- start-minecraftFinalSetup | 2 +- 13 files changed, 265 insertions(+), 194 deletions(-) delete mode 100644 .circleci/config.yml create mode 100644 .github/workflows/build-multiarch.yml create mode 100644 docs/.gitkeep create mode 100644 examples/modpacks/.gitignore create mode 100644 examples/modpacks/README.md create mode 100644 start-deployCF diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 006b7b01..00000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,24 +0,0 @@ -version: 2.1 - -jobs: - minecraft_server: - docker: - - image: docker:18.09.6 - environment: - DOCKER_BUILDKIT: "1" - steps: - - checkout - - setup_remote_docker: - version: 18.09.3 - - run: docker build --platform linux/amd64,linux/arm64,linux/arm/v7 -t itzg/minecraft-server:multiarch . - -workflows: - version: 2 - build: - jobs: - - minecraft_server: - filters: - branches: - ignore: - - armv7 - - multiarch diff --git a/.github/workflows/build-multiarch.yml b/.github/workflows/build-multiarch.yml new file mode 100644 index 00000000..76bffa43 --- /dev/null +++ b/.github/workflows/build-multiarch.yml @@ -0,0 +1,24 @@ +name: Build and publish multiarch +on: + push: + branches: + - ftba-support + - multiarch + +jobs: + docker-buildx: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2.2.0 + - name: Get branch name + uses: nelonoel/branch-name@v1 + - name: Docker Buildx + uses: ilteoood/docker_buildx@1.0.4 + with: + publish: true + imageName: itzg/minecraft-server + tag: ${{ env.BRANCH_NAME }} + dockerHubUser: ${{ secrets.DOCKER_USER }} + dockerHubPassword: ${{ secrets.DOCKER_PASSWORD }} + diff --git a/BUILDING.md b/BUILDING.md index d85990ef..928315bd 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -1,5 +1,5 @@ Ensure buildx/BuildKit support is enabled and run: ``` -docker buildx build --platform=linux/arm64 --platform=linux/arm/v7 --platform=linux/amd64 --tag itzg/minecraft-server:multiarch --push +docker buildx build --platform=linux/arm64 --platform=linux/arm/v7 --platform=linux/amd64 --tag itzg/minecraft-server:multiarch --push . ``` diff --git a/Dockerfile b/Dockerfile index 3e40abb0..ec649986 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,6 +15,7 @@ RUN apt-get update \ tzdata \ rsync \ nano \ + unzip \ && apt-get clean HEALTHCHECK --start-period=1m CMD mc-monitor status --host localhost --port $SERVER_PORT diff --git a/README.md b/README.md index 13e2a4d1..a858698a 100644 --- a/README.md +++ b/README.md @@ -491,20 +491,46 @@ A [Magma](https://magmafoundation.org/) server, which is a combination of Forge > **NOTE** there are limited base versions supported, so you will also need to set `VERSION`, such as "1.12.2" -## Running a Server with a Feed-The-Beast (FTB) / CurseForge modpack +## Running a server with a Feed the Beast modpack -Enable this server mode by adding a `-e TYPE=FTB` or `-e TYPE=CURSEFORGE` to your command-line, +> **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. + +### Environment Variables: +- `FTB_MODPACK_ID`: **required**, the numerical ID of the modpack to install. The ID can be located by finding the modpack at [Neptune FTB](https://ftb.neptunepowered.org/) and using the "Pack ID" +- `FTB_MODPACK_VERSION_ID`: optional, the numerical Id of the version to install. If not specified, the latest version will be installed. The "Version ID" can be obtained by drilling into the Versions tab and clicking a specific version. + +### Upgrading + +If a specific `FTB_MODPACK_VERSION_ID` was not specified, simply restart the container to pick up the newest modpack version. If using a specific version ID, recreate the container with the new version ID. + +### Example + +The following example runs the latest version of [FTB Presents Direwolf20 1.12](https://ftb.neptunepowered.org/pack/ftb-presents-direwolf20-1-12/): + +``` +docker run -d --name mc-ftb -e EULA=TRUE \ + -e TYPE=FTBA -e FTB_MODPACK_ID=31 \ + -p 25565:25565 \ + itzg/minecraft-server:multiarch +``` + +> Normally you will also add `-v` volume for `/data` since the mods and config are installed there along with world data. + +## Running a server with a CurseForge modpack + +Enable this server mode by adding `-e TYPE=CURSEFORGE` to your command-line, but note the following additional steps needed... -You need to specify a modpack to run, using the `FTB_SERVER_MOD` or `CF_SERVER_MOD` environment -variable. An FTB/CurseForge server modpack is available together with its respective -client modpack on under "Additional Files." Similar you can -locate the modpacks for CurseForge at . +You need to specify a modpack to run, using the `CF_SERVER_MOD` environment +variable. A CurseForge server modpack is available together with its respective +client modpack at . -Now you can add a `-e FTB_SERVER_MOD=name_of_modpack.zip` to your command-line. +Now you can add a `-e CF_SERVER_MOD=name_of_modpack.zip` to your command-line. - docker run -d -v /path/on/host:/data -e TYPE=FTB \ - -e FTB_SERVER_MOD=FTBPresentsSkyfactory3Server_3.0.6.zip \ + docker run -d -v /path/on/host:/data -e TYPE=CURSEFORGE \ + -e CF_SERVER_MOD=SkyFactory_4_Server_4.1.0.zip \ -p 25565:25565 -e EULA=TRUE --name mc itzg/minecraft-server If you want to keep the pre-download modpacks separate from your data directory, @@ -512,8 +538,8 @@ then you can attach another volume at a path of your choosing and reference that The following example uses `/modpacks` as the container path as the pre-download area: docker run -d -v /path/on/host:/data -v /path/to/modpacks:/modpacks \ - -e TYPE=FTB \ - -e FTB_SERVER_MOD=/modpacks/FTBPresentsSkyfactory3Server_3.0.6.zip \ + -e TYPE=CURSEFORGE \ + -e CF_SERVER_MOD=/modpacks/SkyFactory_4_Server_4.1.0.zip \ -p 25565:25565 -e EULA=TRUE --name mc itzg/minecraft-server ### Fixing "unable to launch forgemodloader" @@ -526,42 +552,6 @@ then you apply a workaround by adding this to the run invocation: -e FTB_LEGACYJAVAFIXER=true -### Using a client-made curseforge modpack - -If you use something like CurseForge, you may end up creating/using modpacks that do not -contain server mod jars. Instead, the CurseForge setup has `manifest.json` files, which -will show up under `/data/FeedTheBeast/manifest.json`. - -To use these packs you will need to: - -- Specify the manifest location with env var `MANIFEST=/data/FeedTheBeast/manifest` -- Pick a relevant ServerStart.sh and potentially settings.cfg and put them in `/data/FeedTheBeast` - -An example of the latter would be to use -There, you'll find that all you have to do is put `ServerStart.sh` and `settings.cfg` into -`/data/FeedTheBeast`, taking care to update `settings.cfg` to specify your desired version -of minecraft and forge. You can do this in the cli with something like: - -``` -$ wget https://raw.githubusercontent.com/AllTheMods/Server-Scripts/master/ServerStart.sh -$ wget https://raw.githubusercontent.com/AllTheMods/Server-Scripts/master/settings.cfg -$ vim settings.cfg #update the forge version to the one you want. Your manifest.json will have it -$ chmod +x ServerStart.sh -$ docker run -itd --name derpcraft \ - -e MANIFEST=/data/FeedTheBeast/manifest.json \ - -v $PWD/ServerStart.sh:/data/FeedTheBeast/ServerStart.sh \ - -v $PWD/settings.cfg:/data/FeedTheBeast/settings.cfg \ - -e VERSION=1.12.2\ - -e TYPE=CURSEFORGE\ - -e CF_SERVER_MOD=https://minecraft.curseforge.com/projects/your_amazing_modpack/files/2670435/download\ - -p 25565:25565\ - -e EULA=TRUE\ - --restart=always\ - itzg/minecraft-server -``` - -Note the `CF_SERVER_MOD` env var should match the server version of the modpack you are targeting. - ## Running a SpongeVanilla server Enable SpongeVanilla server mode by adding a `-e TYPE=SPONGEVANILLA` to your command-line. diff --git a/docs/.gitkeep b/docs/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/examples/docker-compose-curseforge.yml b/examples/docker-compose-curseforge.yml index 8bdc844e..fbdd8c89 100644 --- a/examples/docker-compose-curseforge.yml +++ b/examples/docker-compose-curseforge.yml @@ -3,9 +3,11 @@ version: '3.2' services: mc: image: itzg/minecraft-server + volumes: + - ./modpacks:/modpacks:ro environment: EULA: "true" - TYPE: FTB - FTB_SERVER_MOD: https://minecraft.curseforge.com/projects/all-the-mods-expert-remastered/files/2493900/download + TYPE: CURSEFORGE + CF_SERVER_MOD: /modpacks/SkyFactory_4_Server_4.1.0.zip ports: - 25565:25565 diff --git a/examples/modpacks/.gitignore b/examples/modpacks/.gitignore new file mode 100644 index 00000000..c4c4ffc6 --- /dev/null +++ b/examples/modpacks/.gitignore @@ -0,0 +1 @@ +*.zip diff --git a/examples/modpacks/README.md b/examples/modpacks/README.md new file mode 100644 index 00000000..17b8e85b --- /dev/null +++ b/examples/modpacks/README.md @@ -0,0 +1,3 @@ +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 . diff --git a/start-configuration b/start-configuration index f91293b9..8a1d3aa0 100644 --- a/start-configuration +++ b/start-configuration @@ -83,10 +83,14 @@ case "${TYPE^^}" in exec /start-deployFabric "$@" ;; - FTB|CURSEFORGE) + FTBA) exec /start-deployFTB "$@" ;; + CURSEFORGE|FTB) + exec /start-deployCF "$@" + ;; + VANILLA) exec /start-deployVanilla "$@" ;; diff --git a/start-deployCF b/start-deployCF new file mode 100644 index 00000000..5b6063e7 --- /dev/null +++ b/start-deployCF @@ -0,0 +1,133 @@ +#!/bin/bash + +. /start-utils + +export FTB_BASE_DIR=/data/FeedTheBeast +legacyJavaFixerUrl=http://ftb.cursecdn.com/FTB2/maven/net/minecraftforge/lex/legacyjavafixer/1.0/legacyjavafixer-1.0.jar +export TYPE=CURSEFORGE + +FTB_SERVER_MOD=${FTB_SERVER_MOD:-$CF_SERVER_MOD} + +log "Looking for CurseForge server modpack." +if [[ -z $FTB_SERVER_MOD ]]; then + log "Environment variable FTB_SERVER_MOD not set." + log "Set FTB_SERVER_MOD to the file name of the FTB server modpack." + log "(And place the modpack in the /data directory.)" + exit 2 +fi + +entryScriptExpr="-name ServerStart.sh -o -name ServerStartLinux.sh -o -name LaunchServer.sh" + +if [[ -d ${FTB_BASE_DIR} ]]; then + startScriptCount=$(find ${FTB_BASE_DIR} $entryScriptExpr |wc -l) + if [[ $startScriptCount > 1 ]]; then + log "Conflicting FTB/CurseForge packages have been installed. Please cleanup ${FTB_BASE_DIR}" + exit 2 + fi +else + startScriptCount=0 +fi + +# only download and install if a mod pack isn't already installed +# also check for the start script rather than just the folder +# this allows saving just the world separate from the rest of the data directory +if [[ $startScriptCount = 0 ]]; then + srv_modpack=${FTB_SERVER_MOD} + if isURL ${srv_modpack}; then + case $srv_modpack in + https://www.feed-the-beast.com/*/download|https://www.curseforge.com/minecraft/modpacks/*/download/*/file) + ;; + https://www.curseforge.com/minecraft/modpacks/*/download/*) + srv_modpack=${srv_modpack}/file;; + https://www.feed-the-beast.com/*) + srv_modpack=${srv_modpack}/download;; + esac + file=$(basename $(dirname $srv_modpack)) + downloaded=/data/${file}.zip + if [ ! -e $downloaded ]; then + log "Downloading FTB modpack... + $srv_modpack -> $downloaded" + curl -sSL -o $downloaded $srv_modpack + fi + srv_modpack=$downloaded + fi + if [[ ${srv_modpack:0:5} == "data/" ]]; then + # Prepend with "/" + srv_modpack=/${srv_modpack} + fi + if [[ ! ${srv_modpack:0:1} == "/" ]]; then + # If not an absolute path, assume file is in "/data" + srv_modpack=/data/${srv_modpack} + fi + if [[ ! -f ${srv_modpack} ]]; then + log "FTB server modpack ${srv_modpack} not found." + exit 2 + fi + if [[ ! ${srv_modpack: -4} == ".zip" ]]; then + log "FTB server modpack ${srv_modpack} is not a zip archive." + log "Please set FTB_SERVER_MOD to a file with a .zip extension." + exit 2 + fi + + log "Unpacking FTB server modpack ${srv_modpack} ..." + mkdir -p ${FTB_BASE_DIR} + unzip -o ${srv_modpack} -d ${FTB_BASE_DIR} | awk '{printf "."} END {print ""}' +fi + +if [[ $(find ${FTB_BASE_DIR} $entryScriptExpr | wc -l) = 0 ]]; then + + # Allow up to 2 levels since some modpacks have a top-level directory named + # for the modpack + forgeJar=$(find ${FTB_BASE_DIR} -maxdepth 2 -name 'forge*.jar' -a -not -name 'forge*installer') + if [[ "$forgeJar" ]]; then + export FTB_BASE_DIR=$(dirname "${forgeJar}") + log "No entry script found, so building one for ${forgeJar}" + cat > "${FTB_BASE_DIR}/ServerStart.sh" < 1 ]]; then + log "Ambigous startup scripts in FTB modpack!" + log "found:" + find ${FTB_BASE_DIR} $entryScriptExpr + exit 2 +fi + +export FTB_SERVER_START=$(find "${FTB_BASE_DIR}" $entryScriptExpr) + +export FTB_DIR=$(dirname "${FTB_SERVER_START}") +chmod a+x "${FTB_SERVER_START}" +grep fml.queryResult=confirm ${FTB_SERVER_START} > /dev/null || \ + sed -i 's/-jar/-Dfml.queryResult=confirm -jar/' "${FTB_SERVER_START}" +sed -i 's/.*read.*Restart now/#\0/' "${FTB_SERVER_START}" +legacyJavaFixerPath="${FTB_DIR}/mods/legacyjavafixer.jar" + +if isTrue ${FTB_LEGACYJAVAFIXER} && [ ! -e "${legacyJavaFixerPath}" ]; then + log "Installing legacy java fixer to ${legacyJavaFixerPath}" + curl -sSL -o "${legacyJavaFixerPath}" ${legacyJavaFixerUrl} +fi + +if [ -e "${FTB_DIR}/FTBInstall.sh" ]; then + pushd "${FTB_DIR}" + sh FTBInstall.sh + popd +elif [ -e "${FTB_DIR}/Install.sh" ]; then + pushd "${FTB_DIR}" + sh Install.sh + popd +fi + +# Continue to Final Setup +exec /start-finalSetup01World $@ diff --git a/start-deployFTB b/start-deployFTB index dfdab6fe..15899f70 100644 --- a/start-deployFTB +++ b/start-deployFTB @@ -1,133 +1,70 @@ #!/bin/bash +ftbInstallMarker=".ftb-installed" + . /start-utils +isDebugging && set -x +set -e -export FTB_BASE_DIR=/data/FeedTheBeast -legacyJavaFixerUrl=http://ftb.cursecdn.com/FTB2/maven/net/minecraftforge/lex/legacyjavafixer/1.0/legacyjavafixer-1.0.jar -export TYPE=FEED-THE-BEAST - -FTB_SERVER_MOD=${FTB_SERVER_MOD:-$CF_SERVER_MOD} - -log "Looking for Feed-The-Beast / CurseForge server modpack." -if [[ -z $FTB_SERVER_MOD ]]; then - log "Environment variable FTB_SERVER_MOD not set." - log "Set FTB_SERVER_MOD to the file name of the FTB server modpack." - log "(And place the modpack in the /data directory.)" - exit 2 +if ! [[ -v FTB_MODPACK_ID ]]; then + log "ERROR FTB_MODPACK_ID is required with TYPE=FTB" + exit 1 fi -entryScriptExpr="-name ServerStart.sh -o -name ServerStartLinux.sh -o -name LaunchServer.sh" +if ! [[ ${FTB_MODPACK_ID} =~ [0-9]+ ]]; then + log "ERROR FTB_MODPACK_ID needs to be numeric" + exit 1 +fi -if [[ -d ${FTB_BASE_DIR} ]]; then - startScriptCount=$(find ${FTB_BASE_DIR} $entryScriptExpr |wc -l) - if [[ $startScriptCount > 1 ]]; then - log "Conflicting FTB/CurseForge packages have been installed. Please cleanup ${FTB_BASE_DIR}" - exit 2 +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} else - startScriptCount=0 + log "FTB modpack ID ${FTB_MODPACK_ID}, version ID ${FTB_MODPACK_VERSION_ID} is ready to go" fi -# only download and install if a mod pack isn't already installed -# also check for the start script rather than just the folder -# this allows saving just the world separate from the rest of the data directory -if [[ $startScriptCount = 0 ]]; then - srv_modpack=${FTB_SERVER_MOD} - if isURL ${srv_modpack}; then - case $srv_modpack in - https://www.feed-the-beast.com/*/download|https://www.curseforge.com/minecraft/modpacks/*/download/*/file) - ;; - https://www.curseforge.com/minecraft/modpacks/*/download/*) - srv_modpack=${srv_modpack}/file;; - https://www.feed-the-beast.com/*) - srv_modpack=${srv_modpack}/download;; - esac - file=$(basename $(dirname $srv_modpack)) - downloaded=/data/${file}.zip - if [ ! -e $downloaded ]; then - log "Downloading FTB modpack... - $srv_modpack -> $downloaded" - curl -sSL -o $downloaded $srv_modpack - fi - srv_modpack=$downloaded +isDebugging && cat version.json +forgeVersion=$(jq -r '.targets[] | select(.name == "forge") | .version' version.json) +mcVersion=$(jq -r '.targets[] | 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 - if [[ ${srv_modpack:0:5} == "data/" ]]; then - # Prepend with "/" - srv_modpack=/${srv_modpack} - fi - if [[ ! ${srv_modpack:0:1} == "/" ]]; then - # If not an absolute path, assume file is in "/data" - srv_modpack=/data/${srv_modpack} - fi - if [[ ! -f ${srv_modpack} ]]; then - log "FTB server modpack ${srv_modpack} not found." - exit 2 - fi - if [[ ! ${srv_modpack: -4} == ".zip" ]]; then - log "FTB server modpack ${srv_modpack} is not a zip archive." - log "Please set FTB_SERVER_MOD to a file with a .zip extension." - exit 2 - fi - - log "Unpacking FTB server modpack ${srv_modpack} ..." - mkdir -p ${FTB_BASE_DIR} - unzip -o ${srv_modpack} -d ${FTB_BASE_DIR} | awk '{printf "."} END {print ""}' -fi - -if [[ $(find ${FTB_BASE_DIR} $entryScriptExpr | wc -l) = 0 ]]; then - - # Allow up to 2 levels since some modpacks have a top-level directory named - # for the modpack - forgeJar=$(find ${FTB_BASE_DIR} -maxdepth 2 -name 'forge*.jar' -a -not -name 'forge*installer') - if [[ "$forgeJar" ]]; then - export FTB_BASE_DIR=$(dirname "${forgeJar}") - log "No entry script found, so building one for ${forgeJar}" - cat > "${FTB_BASE_DIR}/ServerStart.sh" < 1 ]]; then - log "Ambigous startup scripts in FTB modpack!" - log "found:" - find ${FTB_BASE_DIR} $entryScriptExpr - exit 2 -fi - -export FTB_SERVER_START=$(find "${FTB_BASE_DIR}" $entryScriptExpr) - -export FTB_DIR=$(dirname "${FTB_SERVER_START}") -chmod a+x "${FTB_SERVER_START}" -grep fml.queryResult=confirm ${FTB_SERVER_START} > /dev/null || \ - sed -i 's/-jar/-Dfml.queryResult=confirm -jar/' "${FTB_SERVER_START}" -sed -i 's/.*read.*Restart now/#\0/' "${FTB_SERVER_START}" -legacyJavaFixerPath="${FTB_DIR}/mods/legacyjavafixer.jar" - -if isTrue ${FTB_LEGACYJAVAFIXER} && [ ! -e "${legacyJavaFixerPath}" ]; then - log "Installing legacy java fixer to ${legacyJavaFixerPath}" - curl -sSL -o "${legacyJavaFixerPath}" ${legacyJavaFixerUrl} -fi - -if [ -e "${FTB_DIR}/FTBInstall.sh" ]; then - pushd "${FTB_DIR}" - sh FTBInstall.sh - popd -elif [ -e "${FTB_DIR}/Install.sh" ]; then - pushd "${FTB_DIR}" - sh Install.sh - popd +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 /start-finalSetup01World $@ +exec /start-finalSetup01World "$@" diff --git a/start-minecraftFinalSetup b/start-minecraftFinalSetup index 6b1e858c..0fb08d54 100644 --- a/start-minecraftFinalSetup +++ b/start-minecraftFinalSetup @@ -179,7 +179,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} == "FEED-THE-BEAST" ]]; then +elif [[ ${TYPE} == "CURSEFORGE" ]]; then mcServerRunnerArgs="${mcServerRunnerArgs} --shell bash" if [ ! -e "${FTB_DIR}/ops.json" -a -e /data/ops.txt ]; then From 78cb05addad95dc4bdd4502882a385d79398fed4 Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Fri, 19 Jun 2020 15:03:29 -0500 Subject: [PATCH 12/54] ci: added multiarch tags to triggers --- .github/workflows/build-multiarch.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-multiarch.yml b/.github/workflows/build-multiarch.yml index 76bffa43..bca773dd 100644 --- a/.github/workflows/build-multiarch.yml +++ b/.github/workflows/build-multiarch.yml @@ -2,8 +2,9 @@ name: Build and publish multiarch on: push: branches: - - ftba-support - multiarch + tags: + - "[0-9]+.[0-9]+.[0-9]+-multiarch" jobs: docker-buildx: From 6462e1580c009f8953f97d9591dd4143cafae368 Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Sat, 18 Jul 2020 19:29:49 -0500 Subject: [PATCH 13/54] Removed improperly merged apk call --- Dockerfile | 3 --- 1 file changed, 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 284ce02e..f75b7b7c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,9 +2,6 @@ FROM ubuntu:18.04 LABEL org.opencontainers.image.authors="Geoff Bourne " -# upgrade all packages since alpine jre8 base image tops out at 8u212 -RUN apk -U --no-cache upgrade - RUN apt-get update \ && DEBIAN_FRONTEND=noninteractive \ apt-get install -y \ From e442baab31146c2d43089c3504242a9cda7ed7ea Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Sun, 26 Jul 2020 13:50:57 -0500 Subject: [PATCH 14/54] Added writing of eula file after FTBA modpack is installed (#550) --- start-deployFTBA | 2 ++ 1 file changed, 2 insertions(+) diff --git a/start-deployFTBA b/start-deployFTBA index ec912b4a..e96b81dc 100644 --- a/start-deployFTBA +++ b/start-deployFTBA @@ -41,6 +41,8 @@ if ! [ -f "${ftbInstallMarker}" ] || [ $(cat "${ftbInstallMarker}") != "${FTB_MO 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 From c7c4c7497a67b83bd7961841e3655c7dd3eb8434 Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Sun, 26 Jul 2020 13:51:16 -0500 Subject: [PATCH 15/54] docs: Added test multiarch build instruction --- BUILDING.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/BUILDING.md b/BUILDING.md index 928315bd..7b26714c 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -1,5 +1,11 @@ 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 . +``` From 71a48ce10f240cc41f633fdb755b09e2304f0ef9 Mon Sep 17 00:00:00 2001 From: Marc Doughty Date: Sat, 31 Oct 2020 14:36:47 -0400 Subject: [PATCH 16/54] Convert to AdoptOpenJDK (#658) --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index f75b7b7c..bd144c55 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:18.04 +FROM adoptopenjdk:latest LABEL org.opencontainers.image.authors="Geoff Bourne " From cb0add3b90b1babe588a76940e2fa3dbc42fd88f Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Sat, 31 Oct 2020 13:38:44 -0500 Subject: [PATCH 17/54] Added github action match for multiarch-latest branch --- .github/workflows/build-multiarch.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build-multiarch.yml b/.github/workflows/build-multiarch.yml index bca773dd..4bd340e7 100644 --- a/.github/workflows/build-multiarch.yml +++ b/.github/workflows/build-multiarch.yml @@ -3,8 +3,10 @@ on: push: branches: - multiarch + - multiarch-latest tags: - "[0-9]+.[0-9]+.[0-9]+-multiarch" + - "[0-9]+.[0-9]+.[0-9]+-multiarch-latest" jobs: docker-buildx: From 72d7d4a65eb96a481f9b7dd11bd286f1067b206f Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Sat, 31 Oct 2020 14:48:51 -0500 Subject: [PATCH 18/54] Switched to latest Docker buildx github action --- .github/workflows/build-multiarch.yml | 55 ++++++++++++++++++++++----- 1 file changed, 45 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build-multiarch.yml b/.github/workflows/build-multiarch.yml index 4bd340e7..e18d7c72 100644 --- a/.github/workflows/build-multiarch.yml +++ b/.github/workflows/build-multiarch.yml @@ -4,6 +4,7 @@ on: branches: - multiarch - multiarch-latest + - "test-multiarch-.*" tags: - "[0-9]+.[0-9]+.[0-9]+-multiarch" - "[0-9]+.[0-9]+.[0-9]+-multiarch-latest" @@ -14,14 +15,48 @@ jobs: steps: - name: Checkout uses: actions/checkout@v2.2.0 - - name: Get branch name - uses: nelonoel/branch-name@v1 - - name: Docker Buildx - uses: ilteoood/docker_buildx@1.0.4 - with: - publish: true - imageName: itzg/minecraft-server - tag: ${{ env.BRANCH_NAME }} - dockerHubUser: ${{ secrets.DOCKER_USER }} - dockerHubPassword: ${{ secrets.DOCKER_PASSWORD }} + - name: Prepare + id: prep + run: | + DOCKER_IMAGE=itzg/minecraft-server + VERSION=edge + if [[ $GITHUB_REF == refs/tags/* ]]; then + VERSION=${GITHUB_REF#refs/tags/v} + 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} + + - name: Setup Docker Buildx + uses: docker/setup-buildx-action@v1 + + - 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=registry,ref=${{ steps.prep.outputs.cache_from }} + cache-to: type=inline + + - name: Image digest + run: echo ${{ steps.docker_build.outputs.digest }} From 34c45ec8835418309ecb586784ff93f985669151 Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Sat, 31 Oct 2020 14:48:51 -0500 Subject: [PATCH 19/54] Switched to latest Docker buildx github action --- .github/workflows/build-multiarch.yml | 57 ++++++++++++++++++++++----- 1 file changed, 47 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build-multiarch.yml b/.github/workflows/build-multiarch.yml index bca773dd..e18d7c72 100644 --- a/.github/workflows/build-multiarch.yml +++ b/.github/workflows/build-multiarch.yml @@ -3,8 +3,11 @@ on: push: branches: - multiarch + - multiarch-latest + - "test-multiarch-.*" tags: - "[0-9]+.[0-9]+.[0-9]+-multiarch" + - "[0-9]+.[0-9]+.[0-9]+-multiarch-latest" jobs: docker-buildx: @@ -12,14 +15,48 @@ jobs: steps: - name: Checkout uses: actions/checkout@v2.2.0 - - name: Get branch name - uses: nelonoel/branch-name@v1 - - name: Docker Buildx - uses: ilteoood/docker_buildx@1.0.4 - with: - publish: true - imageName: itzg/minecraft-server - tag: ${{ env.BRANCH_NAME }} - dockerHubUser: ${{ secrets.DOCKER_USER }} - dockerHubPassword: ${{ secrets.DOCKER_PASSWORD }} + - name: Prepare + id: prep + run: | + DOCKER_IMAGE=itzg/minecraft-server + VERSION=edge + if [[ $GITHUB_REF == refs/tags/* ]]; then + VERSION=${GITHUB_REF#refs/tags/v} + 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} + + - name: Setup Docker Buildx + uses: docker/setup-buildx-action@v1 + + - 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=registry,ref=${{ steps.prep.outputs.cache_from }} + cache-to: type=inline + + - name: Image digest + run: echo ${{ steps.docker_build.outputs.digest }} From 4d878985d407999e6709cf94b61e40742ba53a06 Mon Sep 17 00:00:00 2001 From: Marc Doughty Date: Tue, 3 Nov 2020 07:33:19 -0500 Subject: [PATCH 20/54] Remove distro-provided JRE (#659) We don't need Java 8 from Ubuntu, we have 15 from AdoptOpenJDK. --- Dockerfile | 1 - 1 file changed, 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index bd144c55..e904c81a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,7 +5,6 @@ LABEL org.opencontainers.image.authors="Geoff Bourne " RUN apt-get update \ && DEBIAN_FRONTEND=noninteractive \ apt-get install -y \ - openjdk-8-jre-headless \ imagemagick \ gosu \ curl wget \ From b7bcd252d33d64c3177c6452f71f321781ebd347 Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Wed, 25 Nov 2020 16:06:01 -0600 Subject: [PATCH 21/54] ci: Fixed tag extraction --- .github/workflows/build-multiarch.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-multiarch.yml b/.github/workflows/build-multiarch.yml index e18d7c72..28387d26 100644 --- a/.github/workflows/build-multiarch.yml +++ b/.github/workflows/build-multiarch.yml @@ -22,7 +22,7 @@ jobs: DOCKER_IMAGE=itzg/minecraft-server VERSION=edge if [[ $GITHUB_REF == refs/tags/* ]]; then - VERSION=${GITHUB_REF#refs/tags/v} + VERSION=${GITHUB_REF#refs/tags/} fi if [[ $GITHUB_REF == refs/heads/* ]]; then VERSION=${GITHUB_REF#refs/heads/} From f97b3bf82e2b116910c3f3e1d25d05bb8130d1ad Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Wed, 25 Nov 2020 21:36:22 -0600 Subject: [PATCH 22/54] Added error handling of FTB installer download For #645 --- start-deployFTBA | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/start-deployFTBA b/start-deployFTBA index e96b81dc..e47fd0fc 100644 --- a/start-deployFTBA +++ b/start-deployFTBA @@ -1,7 +1,5 @@ #!/bin/bash -ftbInstallMarker=".ftb-installed" - . ${SCRIPTS:-/}start-utils isDebugging && set -x set -e @@ -26,14 +24,26 @@ elif ! [[ ${FTB_MODPACK_VERSION_ID} =~ [0-9]+ ]]; then 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 +ftbInstaller=/data/ftb-installer +curlArgs=() +if [ -f "${ftbInstaller}" ]; then + curlArgs+=(-z "${ftbInstaller}") +fi +if isDebugging; then + curlArgs+=(-v) +fi + +log "Downloading FTB installer" +curl -fsSL "${curlArgs[@]}" https://api.modpacks.ch/public/modpack/1/1/server/linux -o "${ftbInstaller}" +if [ $? != 0 ]; then + log "ERROR failed to download FTB installer" + rm -f "${ftbInstaller}" + exit 1 +fi +chmod +x "${ftbInstaller}" + +if ! [ -f "${ftbInstallMarker}" ] || [ $(cat "${ftbInstallMarker}") != "${FTB_MODPACK_ID}=${FTB_MODPACK_VERSION_ID}" ]; then rm -rf forge*jar mods config libraries defaultconfigs changelogs log "Installing modpack ID ${FTB_MODPACK_ID}, version ID ${FTB_MODPACK_VERSION_ID}" From 01130757d63ffc22299a779cf9b2fff53003a9e5 Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Thu, 26 Nov 2020 08:45:51 -0600 Subject: [PATCH 23/54] Reverting FTBA debug change --- start-deployFTBA | 28 +++++++++------------------- 1 file changed, 9 insertions(+), 19 deletions(-) diff --git a/start-deployFTBA b/start-deployFTBA index e47fd0fc..e96b81dc 100644 --- a/start-deployFTBA +++ b/start-deployFTBA @@ -1,5 +1,7 @@ #!/bin/bash +ftbInstallMarker=".ftb-installed" + . ${SCRIPTS:-/}start-utils isDebugging && set -x set -e @@ -24,26 +26,14 @@ elif ! [[ ${FTB_MODPACK_VERSION_ID} =~ [0-9]+ ]]; then exit 1 fi -ftbInstaller=/data/ftb-installer - -curlArgs=() -if [ -f "${ftbInstaller}" ]; then - curlArgs+=(-z "${ftbInstaller}") -fi -if isDebugging; then - curlArgs+=(-v) -fi - -log "Downloading FTB installer" -curl -fsSL "${curlArgs[@]}" https://api.modpacks.ch/public/modpack/1/1/server/linux -o "${ftbInstaller}" -if [ $? != 0 ]; then - log "ERROR failed to download FTB installer" - rm -f "${ftbInstaller}" - exit 1 -fi -chmod +x "${ftbInstaller}" - 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}" From c458823014381366a4798160c35594f0ad6b2504 Mon Sep 17 00:00:00 2001 From: Andrew Lambeth Date: Sat, 26 Dec 2020 12:44:37 -0800 Subject: [PATCH 24/54] ignore duplicate entries in the targets array of version.json (#698) --- start-deployFTBA | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/start-deployFTBA b/start-deployFTBA index e96b81dc..19800f9a 100644 --- a/start-deployFTBA +++ b/start-deployFTBA @@ -48,8 +48,8 @@ else fi isDebugging && cat version.json -forgeVersion=$(jq -r '.targets[] | select(.name == "forge") | .version' version.json) -mcVersion=$(jq -r '.targets[] | select(.name == "minecraft") | .version' 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 From 51e6d5dfbd659d9f0bdd0f4fcebb5879b4f4c6fc Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Mon, 28 Dec 2020 11:42:54 -0600 Subject: [PATCH 25/54] Added install of sudo For #699 --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index 6b59ce61..b049e493 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,6 +8,7 @@ RUN apt-get update \ openjdk-8-jre-headless \ imagemagick \ gosu \ + sudo \ curl wget \ jq \ dos2unix \ From ffb50cfe28346c1b64df2c16021c2a1d42b63304 Mon Sep 17 00:00:00 2001 From: ErstBlack <52228294+ErstBlack@users.noreply.github.com> Date: Thu, 31 Dec 2020 14:15:44 -0500 Subject: [PATCH 26/54] Fixing AUTOPAUSE on Raspberry Pi 4s (#708) * Replacing killall with pkill and ps -a to ps -ax * Adding net-tools and removing -q from pkill * Missed the resume.sh * Christ there's a lot of ps calls * Adding -x to health.sh, replacing killall with pkill in sudoers-mv, and replacing su-exec with gosu in knockd-config.cfg Co-authored-by: sean.sullivan.ctr@progeny.net --- Dockerfile | 1 + files/autopause/autopause-daemon.sh | 4 ++-- files/autopause/autopause-fcns.sh | 4 ++-- files/autopause/knockd-config.cfg | 4 ++-- files/autopause/pause.sh | 4 ++-- files/autopause/resume.sh | 4 ++-- files/sudoers-mc | 2 +- health.sh | 2 +- 8 files changed, 13 insertions(+), 12 deletions(-) diff --git a/Dockerfile b/Dockerfile index b049e493..5b05af5d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,6 +9,7 @@ RUN apt-get update \ imagemagick \ gosu \ sudo \ + net-tools \ curl wget \ jq \ dos2unix \ diff --git a/files/autopause/autopause-daemon.sh b/files/autopause/autopause-daemon.sh index e46fdffa..0c757993 100644 --- a/files/autopause/autopause-daemon.sh +++ b/files/autopause/autopause-daemon.sh @@ -8,7 +8,7 @@ sudo /usr/sbin/knockd -c /tmp/knockd-config.cfg -d if [ $? -ne 0 ] ; then while : do - if [[ -n $(ps -o comm | grep java) ]] ; then + if [[ -n $(ps -ax -o comm | grep java) ]] ; then break fi sleep 0.1 @@ -17,7 +17,7 @@ if [ $? -ne 0 ] ; then logAutopause "Possible cause: docker's host network mode." logAutopause "Recreate without host mode or disable autopause functionality." logAutopause "Stopping server." - killall -SIGTERM java + pkill -SIGTERM java exit 1 fi diff --git a/files/autopause/autopause-fcns.sh b/files/autopause/autopause-fcns.sh index 5ebae93c..31f016a6 100644 --- a/files/autopause/autopause-fcns.sh +++ b/files/autopause/autopause-fcns.sh @@ -5,11 +5,11 @@ current_uptime() { } java_running() { - [[ $( ps -a -o stat,comm | grep 'java' | awk '{ print $1 }') =~ ^S.*$ ]] + [[ $( ps -ax -o stat,comm | grep 'java' | awk '{ print $1 }') =~ ^S.*$ ]] } rcon_client_exists() { - [[ -n "$(ps -a -o comm | grep 'rcon-cli')" ]] + [[ -n "$(ps -ax -o comm | grep 'rcon-cli')" ]] } mc_server_listening() { diff --git a/files/autopause/knockd-config.cfg b/files/autopause/knockd-config.cfg index 86c98d02..68ab28de 100644 --- a/files/autopause/knockd-config.cfg +++ b/files/autopause/knockd-config.cfg @@ -3,10 +3,10 @@ [unpauseMCServer-server] sequence = 25565 seq_timeout = 1 - command = /sbin/su-exec minecraft:minecraft /autopause/resume.sh + command = /usr/sbin/gosu minecraft:minecraft /autopause/resume.sh tcpflags = syn [unpauseMCServer-rcon] sequence = 25575 seq_timeout = 1 - command = /sbin/su-exec minecraft:minecraft /autopause/resume.sh + command = /usr/sbin/gosu minecraft:minecraft /autopause/resume.sh tcpflags = syn diff --git a/files/autopause/pause.sh b/files/autopause/pause.sh index c84bdda5..bcd1a06c 100755 --- a/files/autopause/pause.sh +++ b/files/autopause/pause.sh @@ -2,7 +2,7 @@ . /start-utils -if [[ $( ps -a -o stat,comm | grep 'java' | awk '{ print $1 }') =~ ^S.*$ ]] ; then +if [[ $( ps -ax -o stat,comm | grep 'java' | awk '{ print $1 }') =~ ^S.*$ ]] ; then # save world rcon-cli save-all >/dev/null @@ -17,5 +17,5 @@ if [[ $( ps -a -o stat,comm | grep 'java' | awk '{ print $1 }') =~ ^S.*$ ]] ; th # finally pause the process logAutopauseAction "Pausing Java process" - killall -q -STOP java + pkill -STOP java fi diff --git a/files/autopause/resume.sh b/files/autopause/resume.sh index 73ab648e..6ae5a8cf 100755 --- a/files/autopause/resume.sh +++ b/files/autopause/resume.sh @@ -2,7 +2,7 @@ . /start-utils -if [[ $( ps -a -o stat,comm | grep 'java' | awk '{ print $1 }') =~ ^T.*$ ]] ; then +if [[ $( ps -ax -o stat,comm | grep 'java' | awk '{ print $1 }') =~ ^T.*$ ]] ; then logAutopauseAction "Knocked, resuming Java process" - killall -q -CONT java + pkill -CONT java fi diff --git a/files/sudoers-mc b/files/sudoers-mc index 419c352e..39926d72 100644 --- a/files/sudoers-mc +++ b/files/sudoers-mc @@ -1,2 +1,2 @@ -%minecraft ALL=(ALL) NOPASSWD:/usr/bin/killall +%minecraft ALL=(ALL) NOPASSWD:/usr/bin/pkill %minecraft ALL=(ALL) NOPASSWD:/usr/sbin/knockd diff --git a/health.sh b/health.sh index e2ad7e72..a3f14aa6 100644 --- a/health.sh +++ b/health.sh @@ -5,7 +5,7 @@ if isTrue "${DISABLE_HEALTHCHECK}"; then echo "Healthcheck disabled" exit 0 -elif isTrue "${ENABLE_AUTOPAUSE}" && [[ "$( ps -a -o stat,comm | grep 'java' | awk '{ print $1 }')" =~ ^T.*$ ]]; then +elif isTrue "${ENABLE_AUTOPAUSE}" && [[ "$( ps -ax -o stat,comm | grep 'java' | awk '{ print $1 }')" =~ ^T.*$ ]]; then echo "Java process suspended by Autopause function" exit 0 else From 9469291731bacf1655f8eca52405889bb9a58b8e Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Sat, 9 Jan 2021 12:28:27 -0600 Subject: [PATCH 27/54] ci: Switched multiarch build caching to github actions --- .github/workflows/build-multiarch.yml | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-multiarch.yml b/.github/workflows/build-multiarch.yml index 28387d26..1a1baf3a 100644 --- a/.github/workflows/build-multiarch.yml +++ b/.github/workflows/build-multiarch.yml @@ -4,14 +4,14 @@ on: branches: - multiarch - multiarch-latest - - "test-multiarch-.*" + - "test/multiarch-*" tags: - "[0-9]+.[0-9]+.[0-9]+-multiarch" - "[0-9]+.[0-9]+.[0-9]+-multiarch-latest" jobs: docker-buildx: - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 steps: - name: Checkout uses: actions/checkout@v2.2.0 @@ -30,13 +30,22 @@ jobs: VERSION=latest fi fi - TAGS="${DOCKER_IMAGE}:${VERSION}" + TAGS="${DOCKER_IMAGE}:${VERSION//\//-}" echo ::set-output name=tags::${TAGS} echo ::set-output name=cache_from::${TAGS} + 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 }}- + - name: Set up QEMU uses: docker/setup-qemu-action@v1 @@ -55,8 +64,8 @@ jobs: platforms: linux/amd64,linux/arm/v7,linux/arm64 push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.prep.outputs.tags }} - cache-from: type=registry,ref=${{ steps.prep.outputs.cache_from }} - cache-to: type=inline + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache - name: Image digest run: echo ${{ steps.docker_build.outputs.digest }} From 02c8393bc63bb1b9dc00b544948920fbcdbabc9b Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Sat, 9 Jan 2021 14:07:05 -0600 Subject: [PATCH 28/54] ci: Added opencontainers labels --- .github/workflows/build-multiarch.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-multiarch.yml b/.github/workflows/build-multiarch.yml index 1a1baf3a..ee0083c7 100644 --- a/.github/workflows/build-multiarch.yml +++ b/.github/workflows/build-multiarch.yml @@ -4,7 +4,7 @@ on: branches: - multiarch - multiarch-latest - - "test/multiarch-*" + - test/multiarch/* tags: - "[0-9]+.[0-9]+.[0-9]+-multiarch" - "[0-9]+.[0-9]+.[0-9]+-multiarch-latest" @@ -33,6 +33,7 @@ jobs: 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 @@ -66,6 +67,11 @@ jobs: 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 }} From b519c43e1682fe61e34457afbf99161cf7e2c29b Mon Sep 17 00:00:00 2001 From: Michael Kirsch Date: Tue, 12 Jan 2021 23:05:12 +0100 Subject: [PATCH 29/54] fix multiarch autopause daemon (#722) --- files/autopause/autopause-daemon.sh | 36 +++++++++++++++++++++-------- files/autopause/autopause-fcns.sh | 2 +- 2 files changed, 28 insertions(+), 10 deletions(-) diff --git a/files/autopause/autopause-daemon.sh b/files/autopause/autopause-daemon.sh index 5c49cce5..e2f48608 100644 --- a/files/autopause/autopause-daemon.sh +++ b/files/autopause/autopause-daemon.sh @@ -15,17 +15,35 @@ autopause_error_loop() { logAutopause "Autopause failed to initialize. This log entry will be printed every 30 minutes." while : do - if [[ -n $(ps -ax -o comm | grep java) ]] ; then - break - fi - sleep 0.1 + sleep 1800 + logAutopause "Autopause failed to initialize." 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 "Possible cause: docker's host network mode." - logAutopause "Recreate without host mode or disable autopause functionality." - logAutopause "Stopping server." - pkill -SIGTERM java - exit 1 + logAutopause "Probable cause: Unable to attach to interface \"$AUTOPAUSE_KNOCK_INTERFACE\"." + autopause_error_loop fi STATE=INIT diff --git a/files/autopause/autopause-fcns.sh b/files/autopause/autopause-fcns.sh index 69b7f9e4..69eb9d08 100644 --- a/files/autopause/autopause-fcns.sh +++ b/files/autopause/autopause-fcns.sh @@ -9,7 +9,7 @@ java_running() { } java_process_exists() { - [[ -n "$(ps -a -o comm | grep 'java')" ]] + [[ -n "$(ps -ax -o comm | grep 'java')" ]] } rcon_client_exists() { From a698248dff13de0140da0383bf9411c4ee9afc07 Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Sat, 6 Feb 2021 14:50:43 -0600 Subject: [PATCH 30/54] ci: Based on adoptopenjdk:15-jre --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index a2a590fe..2a713e9e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM adoptopenjdk:latest +FROM adoptopenjdk:15-jre LABEL org.opencontainers.image.authors="Geoff Bourne " From f856276d71f2f0c2e6812918032a6e7172ee440c Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Mon, 1 Feb 2021 17:29:09 -0600 Subject: [PATCH 31/54] Upgraded multiarch to Java 11 --- Dockerfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 31d84a6d..13f1782a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,10 @@ -FROM ubuntu:18.04 +FROM adoptopenjdk:11-jre LABEL org.opencontainers.image.authors="Geoff Bourne " RUN apt-get update \ && DEBIAN_FRONTEND=noninteractive \ apt-get install -y \ - openjdk-8-jre-headless \ imagemagick \ gosu \ sudo \ From f397dd71a9e6891eb39194a42cffff28baa737f6 Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Thu, 11 Feb 2021 14:52:51 -0600 Subject: [PATCH 32/54] Fix PATH to include java when needed --- start-minecraftFinalSetup | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/start-minecraftFinalSetup b/start-minecraftFinalSetup index b9a35ba9..3a2d1df1 100644 --- a/start-minecraftFinalSetup +++ b/start-minecraftFinalSetup @@ -170,7 +170,7 @@ function copyFilesForCurseForge() { if ! which java > /dev/null; then log "Fixing PATH to include java" - PATH="${PATH}:/usr/bin" + PATH="${PATH}:/opt/java/openjdk/bin" fi mcServerRunnerArgs="--stop-duration ${STOP_DURATION:-60}s" From 89afba7437f94f7d43d664e91a51d8690a65beaf Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Sat, 27 Feb 2021 16:58:25 -0600 Subject: [PATCH 33/54] Ensure FTBA version.json is readable #784 --- start-deployFTBA | 3 +++ 1 file changed, 3 insertions(+) diff --git a/start-deployFTBA b/start-deployFTBA index 19800f9a..38fae975 100644 --- a/start-deployFTBA +++ b/start-deployFTBA @@ -43,6 +43,9 @@ if ! [ -f "${ftbInstallMarker}" ] || [ $(cat "${ftbInstallMarker}") != "${FTB_MO echo "${FTB_MODPACK_ID}=${FTB_MODPACK_VERSION_ID}" > ${ftbInstallMarker} writeEula + + # some modpacks result in --w----r-- permissions + chmod a+r version.json else log "FTB modpack ID ${FTB_MODPACK_ID}, version ID ${FTB_MODPACK_VERSION_ID} is ready to go" fi From 21572d35471397d448ca2ed33c9572bbd5741050 Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Sat, 27 Feb 2021 16:58:25 -0600 Subject: [PATCH 34/54] Ensure FTBA version.json is readable #784 --- start-deployFTBA | 3 +++ 1 file changed, 3 insertions(+) diff --git a/start-deployFTBA b/start-deployFTBA index 19800f9a..38fae975 100644 --- a/start-deployFTBA +++ b/start-deployFTBA @@ -43,6 +43,9 @@ if ! [ -f "${ftbInstallMarker}" ] || [ $(cat "${ftbInstallMarker}") != "${FTB_MO echo "${FTB_MODPACK_ID}=${FTB_MODPACK_VERSION_ID}" > ${ftbInstallMarker} writeEula + + # some modpacks result in --w----r-- permissions + chmod a+r version.json else log "FTB modpack ID ${FTB_MODPACK_ID}, version ID ${FTB_MODPACK_VERSION_ID} is ready to go" fi From ebabfeb66930cd3545f40002db9047630015b297 Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Sat, 6 Mar 2021 16:05:01 -0600 Subject: [PATCH 35/54] Shifted PATH-fix earlier in startup --- start-configuration | 5 +++++ start-minecraftFinalSetup | 5 ----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/start-configuration b/start-configuration index 12a2ef93..6b2be3eb 100644 --- a/start-configuration +++ b/start-configuration @@ -54,6 +54,11 @@ if [[ $RCON_PASSWORD_FILE ]]; then log "" fi +if ! which java > /dev/null; then + log "Fixing PATH to include java" + PATH="${PATH}:/opt/java/openjdk/bin" +fi + export VERSIONS_JSON=https://launchermeta.mojang.com/mc/game/version_manifest.json case "X$VERSION" in diff --git a/start-minecraftFinalSetup b/start-minecraftFinalSetup index d630d3a9..3d0f7c75 100644 --- a/start-minecraftFinalSetup +++ b/start-minecraftFinalSetup @@ -167,11 +167,6 @@ function copyFilesForCurseForge() { cp -f /data/eula.txt "${FTB_DIR}/" } -if ! which java > /dev/null; then - log "Fixing PATH to include java" - PATH="${PATH}:/opt/java/openjdk/bin" -fi - mcServerRunnerArgs="--stop-duration ${STOP_DURATION:-60}s" if [[ ${TYPE} == "CURSE_INSTANCE" ]]; then if isTrue ${DEBUG_EXEC}; then From 44769b6001ef54bad89ace246d73efce6e88867e Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Sat, 6 Mar 2021 16:06:43 -0600 Subject: [PATCH 36/54] Shifted PATH-fix earlier in startup --- start-configuration | 5 +++++ start-minecraftFinalSetup | 5 ----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/start-configuration b/start-configuration index 12a2ef93..6b2be3eb 100644 --- a/start-configuration +++ b/start-configuration @@ -54,6 +54,11 @@ if [[ $RCON_PASSWORD_FILE ]]; then log "" fi +if ! which java > /dev/null; then + log "Fixing PATH to include java" + PATH="${PATH}:/opt/java/openjdk/bin" +fi + export VERSIONS_JSON=https://launchermeta.mojang.com/mc/game/version_manifest.json case "X$VERSION" in diff --git a/start-minecraftFinalSetup b/start-minecraftFinalSetup index d630d3a9..3d0f7c75 100644 --- a/start-minecraftFinalSetup +++ b/start-minecraftFinalSetup @@ -167,11 +167,6 @@ function copyFilesForCurseForge() { cp -f /data/eula.txt "${FTB_DIR}/" } -if ! which java > /dev/null; then - log "Fixing PATH to include java" - PATH="${PATH}:/opt/java/openjdk/bin" -fi - mcServerRunnerArgs="--stop-duration ${STOP_DURATION:-60}s" if [[ ${TYPE} == "CURSE_INSTANCE" ]]; then if isTrue ${DEBUG_EXEC}; then From e5948081a7b9f29f4b352aecc0258ca77b86bd90 Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Thu, 1 Apr 2021 16:27:50 -0500 Subject: [PATCH 37/54] Added git #819 --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index d9e0cf5e..d519a9c0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,6 +10,7 @@ RUN apt-get update \ sudo \ net-tools \ curl wget \ + git \ jq \ dos2unix \ mysql-client \ From 60a68963a8865bf01ec11c9bceac40a376c8e762 Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Thu, 1 Apr 2021 16:27:50 -0500 Subject: [PATCH 38/54] Added git #819 --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index 5dd2f76a..92ca0d5b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,6 +10,7 @@ RUN apt-get update \ sudo \ net-tools \ curl wget \ + git \ jq \ dos2unix \ mysql-client \ From a8c11c0cdb0a3a3315c45ee3234856f8174ca361 Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Wed, 12 May 2021 11:32:40 -0500 Subject: [PATCH 39/54] Add java16 branch/image-tag #864 --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 986bba2f..56c9ecdd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM adoptopenjdk:15-jre +FROM adoptopenjdk:16-jre LABEL org.opencontainers.image.authors="Geoff Bourne " From 671e84bec94e0878ef125df557ea8705894af821 Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Fri, 14 May 2021 17:48:17 -0500 Subject: [PATCH 40/54] ci: use docker/metadata-action --- .github/workflows/build-multiarch.yml | 41 +++++++++------------------ 1 file changed, 13 insertions(+), 28 deletions(-) diff --git a/.github/workflows/build-multiarch.yml b/.github/workflows/build-multiarch.yml index d810a02a..ba139c7b 100644 --- a/.github/workflows/build-multiarch.yml +++ b/.github/workflows/build-multiarch.yml @@ -22,25 +22,15 @@ jobs: - name: Checkout uses: actions/checkout@v2.3.4 - - 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: Docker meta + id: meta + uses: docker/metadata-action@v3 + with: + images: | + itzg/minecraft-server + tags: | + type=ref,event=branch + type=ref,event=tag - name: Setup Docker Buildx uses: docker/setup-buildx-action@v1 @@ -49,9 +39,9 @@ jobs: uses: actions/cache@v2.1.5 with: path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ steps.prep.outputs.cache_version }}-${{ github.sha }} + key: ${{ runner.os }}-buildx-${{ steps.meta.outputs.version }}-${{ github.sha }} restore-keys: | - ${{ runner.os }}-buildx-${{ steps.prep.outputs.cache_version }}- + ${{ runner.os }}-buildx-${{ steps.meta.outputs.version }}- - name: Set up QEMU uses: docker/setup-qemu-action@v1.1.0 @@ -67,19 +57,14 @@ jobs: uses: docker/build-push-action@v2.4.0 with: context: . - file: ./Dockerfile platforms: linux/amd64,linux/arm/v7,linux/arm64 push: ${{ github.event_name != 'pull_request' }} - tags: ${{ steps.prep.outputs.tags }} + tags: ${{ steps.meta.outputs.tags }} # ensure latest base image is used pull: true 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 }} + labels: ${{ steps.meta.outputs.labels }} - name: Image digest run: echo ${{ steps.docker_build.outputs.digest }} From 98c7e439277cc99729fdfc2e25fae24931324cb5 Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Wed, 19 May 2021 20:47:48 -0500 Subject: [PATCH 41/54] ci: prefixed TOC commit message --- .github/workflows/generate-toc.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/generate-toc.yml b/.github/workflows/generate-toc.yml index 4a31c0b1..104e8f3f 100644 --- a/.github/workflows/generate-toc.yml +++ b/.github/workflows/generate-toc.yml @@ -17,4 +17,4 @@ jobs: ./gh-md-toc --insert --no-backup README.md - uses: stefanzweifel/git-auto-commit-action@v4.11.0 with: - commit_message: Auto update markdown TOC \ No newline at end of file + commit_message: "docs: Auto update markdown TOC" \ No newline at end of file From eb490e92c31c9015616982ebd666f3f6263692c6 Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Fri, 21 May 2021 06:50:04 -0500 Subject: [PATCH 42/54] ci: force rebuild of latest --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index b9f2fb36..237b6a0c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -84,5 +84,6 @@ RUN dos2unix /start* && chmod +x /start* RUN dos2unix /health.sh && chmod +x /health.sh RUN dos2unix /autopause/* && chmod +x /autopause/*.sh + ENTRYPOINT [ "/start" ] HEALTHCHECK --start-period=1m CMD /health.sh From ecafaf4ea1d7ae5b1e91c99437b25ab77fac2a79 Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Fri, 21 May 2021 06:51:17 -0500 Subject: [PATCH 43/54] ci: force rebuild of latest --- start-minecraftFinalSetup | 1 + 1 file changed, 1 insertion(+) diff --git a/start-minecraftFinalSetup b/start-minecraftFinalSetup index 75cfcf21..a6edf5c2 100644 --- a/start-minecraftFinalSetup +++ b/start-minecraftFinalSetup @@ -246,3 +246,4 @@ else exec mc-server-runner ${bootstrapArgs} ${mcServerRunnerArgs} java "${finalArgs[@]}" fi fi + From 853a9884d741c22e4fc628e41b27e21c4dad0f6c Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Fri, 21 May 2021 06:57:19 -0500 Subject: [PATCH 44/54] ci: force apk update --- Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Dockerfile b/Dockerfile index 237b6a0c..5d12e2bd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,7 @@ FROM adoptopenjdk/openjdk11:alpine-jre +ENV APK_UPDATE=20210521 + LABEL org.opencontainers.image.authors="Geoff Bourne " RUN apk add --no-cache -U \ From 5fc36516f4160543b52614daa4e11324a55dd7b1 Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Fri, 21 May 2021 07:39:59 -0500 Subject: [PATCH 45/54] ci: switch 'latest/master' build to multiarch --- .github/workflows/build-multiarch.yml | 2 ++ .github/workflows/main.yml | 2 -- Dockerfile | 2 -- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-multiarch.yml b/.github/workflows/build-multiarch.yml index f6fc020f..9475222d 100644 --- a/.github/workflows/build-multiarch.yml +++ b/.github/workflows/build-multiarch.yml @@ -2,12 +2,14 @@ name: Build and publish multiarch on: push: branches: + - latest - multiarch - multiarch-latest - java15 - java16 - test/multiarch/* tags: + - "[0-9]+.[0-9]+.[0-9]+" - "[0-9]+.[0-9]+.[0-9]+-multiarch" - "[0-9]+.[0-9]+.[0-9]+-multiarch-latest" - "[0-9]+.[0-9]+.[0-9]+-java15" diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6d74d3e5..d402dcdc 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -3,14 +3,12 @@ name: Build and Publish on: push: branches: - - master - java8 - openj9 - openj9-11 - adopt11 - test/* 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" diff --git a/Dockerfile b/Dockerfile index 669fd26f..c74276c1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,5 @@ FROM adoptopenjdk:16-jre -ENV APK_UPDATE=20210521 - LABEL org.opencontainers.image.authors="Geoff Bourne " RUN apt-get update \ From 9c87f8749d52c1b6383132fb71fda1fad7e3f0b7 Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Fri, 21 May 2021 07:40:46 -0500 Subject: [PATCH 46/54] docs: updated README for latest=16 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 797590a5..a3bcfbd3 100644 --- a/README.md +++ b/README.md @@ -274,7 +274,7 @@ To use a different version of Java, please use a docker tag to run your Minecraf | Tag name | Java version | Linux | JVM Type | Architecture | | -------------- | -------------|--------|----------|-------------------| -| latest | 11 | Alpine | Hotspot | amd64 | +| latest | 16 | Debian | Hotspot | amd64,arm64,armv7 | | java8 | 8 | Alpine | Hotspot | amd64 | | java8-multiarch | 8 | Debian | Hotspot | amd64,arm64,armv7 | | java15 | 15 | Debian | Hotspot | amd64,arm64,armv7 | From 63412975c335a33a9139a0d487d78cca46bb5484 Mon Sep 17 00:00:00 2001 From: itzg Date: Fri, 21 May 2021 12:45:51 +0000 Subject: [PATCH 47/54] docs: Auto update markdown TOC --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a3bcfbd3..c7f85038 100644 --- a/README.md +++ b/README.md @@ -143,7 +143,7 @@ By default, the container will download the latest version of the "vanilla" [Min * [Enabling Autopause](#enabling-autopause) * [Running on RaspberryPi](#running-on-raspberrypi) - + From 317104de301835f960314c6bca162e189211a01f Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Fri, 21 May 2021 07:46:49 -0500 Subject: [PATCH 48/54] ci: fixed multiarch 'master' branch trigger --- .github/workflows/build-multiarch.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-multiarch.yml b/.github/workflows/build-multiarch.yml index 9475222d..3bfed034 100644 --- a/.github/workflows/build-multiarch.yml +++ b/.github/workflows/build-multiarch.yml @@ -2,7 +2,7 @@ name: Build and publish multiarch on: push: branches: - - latest + - master - multiarch - multiarch-latest - java15 From 78ec4ba2a7509ba22643c940dc2037f6f6588802 Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Fri, 21 May 2021 07:59:04 -0500 Subject: [PATCH 49/54] ci: multiarch build reference master branch --- .github/workflows/build-multiarch.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-multiarch.yml b/.github/workflows/build-multiarch.yml index 3bfed034..4204d591 100644 --- a/.github/workflows/build-multiarch.yml +++ b/.github/workflows/build-multiarch.yml @@ -35,6 +35,7 @@ jobs: tags: | type=ref,event=branch type=ref,event=tag + type=edge,branch=master - name: Setup Docker Buildx uses: docker/setup-buildx-action@v1 From cb17180dea271f8880b0b180ee8f576fe8de58e9 Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Fri, 21 May 2021 16:45:33 -0500 Subject: [PATCH 50/54] ci: updated build action for java16-openj9 #885 --- .github/workflows/build-multiarch.yml | 4 ++-- README.md | 2 +- docker-versions-create.sh | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-multiarch.yml b/.github/workflows/build-multiarch.yml index 4204d591..1e8406d8 100644 --- a/.github/workflows/build-multiarch.yml +++ b/.github/workflows/build-multiarch.yml @@ -6,14 +6,14 @@ on: - multiarch - multiarch-latest - java15 - - java16 + - java16* - test/multiarch/* tags: - "[0-9]+.[0-9]+.[0-9]+" - "[0-9]+.[0-9]+.[0-9]+-multiarch" - "[0-9]+.[0-9]+.[0-9]+-multiarch-latest" - "[0-9]+.[0-9]+.[0-9]+-java15" - - "[0-9]+.[0-9]+.[0-9]+-java16" + - "[0-9]+.[0-9]+.[0-9]+-java16*" paths-ignore: - "*.md" - "docs/**" diff --git a/README.md b/README.md index c7f85038..04bfa0b1 100644 --- a/README.md +++ b/README.md @@ -278,8 +278,8 @@ To use a different version of Java, please use a docker tag to run your Minecraf | java8 | 8 | Alpine | Hotspot | amd64 | | java8-multiarch | 8 | Debian | Hotspot | amd64,arm64,armv7 | | java15 | 15 | Debian | Hotspot | amd64,arm64,armv7 | -| java15-openj9 | 15 | Debian | OpenJ9 | amd64,arm64 | | java16 | 16 | Debian | Hotspot | amd64,arm64,armv7 | +| java16-openj9 | 16 | Debian | OpenJ9 | amd64,arm64,armv7 | | adopt11 | 11 | Alpine | Hotspot | amd64 | | openj9 | 8 | Alpine | OpenJ9 | amd64 | | openj9-11 | 11 | Alpine | OpenJ9 | amd64 | diff --git a/docker-versions-create.sh b/docker-versions-create.sh index 54736a20..b006f6aa 100755 --- a/docker-versions-create.sh +++ b/docker-versions-create.sh @@ -8,8 +8,8 @@ branches_list=( 'openj9-11' 'adopt11' 'java15' - 'java15-openj9' 'java16' + 'java16-openj9' 'multiarch' 'multiarch-latest' ) From b806ea687152251ad7e34ae50e970afde90d1602 Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Fri, 21 May 2021 16:53:22 -0500 Subject: [PATCH 51/54] docs: adoptopenjdk:16-openj9 is only available on amd64 #885 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 04bfa0b1..d084f23b 100644 --- a/README.md +++ b/README.md @@ -279,7 +279,7 @@ To use a different version of Java, please use a docker tag to run your Minecraf | java8-multiarch | 8 | Debian | Hotspot | amd64,arm64,armv7 | | java15 | 15 | Debian | Hotspot | amd64,arm64,armv7 | | java16 | 16 | Debian | Hotspot | amd64,arm64,armv7 | -| java16-openj9 | 16 | Debian | OpenJ9 | amd64,arm64,armv7 | +| java16-openj9 | 16 | Debian | OpenJ9 | amd64 | | adopt11 | 11 | Alpine | Hotspot | amd64 | | openj9 | 8 | Alpine | OpenJ9 | amd64 | | openj9-11 | 11 | Alpine | OpenJ9 | amd64 | From e8f8d8b4d4caa478b0dcf255aef98143f2b22168 Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Fri, 21 May 2021 16:58:52 -0500 Subject: [PATCH 52/54] ci: introduced CACHE_NAME --- .github/workflows/build-multiarch.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-multiarch.yml b/.github/workflows/build-multiarch.yml index 1e8406d8..128f4199 100644 --- a/.github/workflows/build-multiarch.yml +++ b/.github/workflows/build-multiarch.yml @@ -22,6 +22,8 @@ on: jobs: docker-buildx: runs-on: ubuntu-20.04 + env: + CACHE_NAME: master steps: - name: Checkout uses: actions/checkout@v2.3.4 @@ -44,9 +46,9 @@ jobs: uses: actions/cache@v2.1.5 with: path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ steps.meta.outputs.version }}-${{ github.sha }} + key: ${{ runner.os }}-buildx-${{ env.CACHE_NAME }}-${{ github.sha }} restore-keys: | - ${{ runner.os }}-buildx-${{ steps.meta.outputs.version }}- + ${{ runner.os }}-buildx-${{ env.CACHE_NAME }}- - name: Set up QEMU uses: docker/setup-qemu-action@v1.1.0 From 93cd299c77637d2045a3fd09f014c9d8c0a43321 Mon Sep 17 00:00:00 2001 From: itzg Date: Fri, 21 May 2021 21:59:13 +0000 Subject: [PATCH 53/54] docs: Auto update markdown TOC --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d084f23b..e4212b1e 100644 --- a/README.md +++ b/README.md @@ -143,7 +143,7 @@ By default, the container will download the latest version of the "vanilla" [Min * [Enabling Autopause](#enabling-autopause) * [Running on RaspberryPi](#running-on-raspberrypi) - + From a5fe016854c2792be2eed52a59dd2e3d4fa03aab Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Fri, 21 May 2021 17:00:50 -0500 Subject: [PATCH 54/54] docs: added edge tag to image versions section --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index e4212b1e..e626021b 100644 --- a/README.md +++ b/README.md @@ -275,6 +275,7 @@ To use a different version of Java, please use a docker tag to run your Minecraf | Tag name | Java version | Linux | JVM Type | Architecture | | -------------- | -------------|--------|----------|-------------------| | latest | 16 | Debian | Hotspot | amd64,arm64,armv7 | +| edge | 16 | Debian | Hotspot | amd64,arm64,armv7 | | java8 | 8 | Alpine | Hotspot | amd64 | | java8-multiarch | 8 | Debian | Hotspot | amd64,arm64,armv7 | | java15 | 15 | Debian | Hotspot | amd64,arm64,armv7 |