diff --git a/.github/workflows/build-multiarch.yml b/.github/workflows/build-multiarch.yml new file mode 100644 index 00000000..a0ec4aa8 --- /dev/null +++ b/.github/workflows/build-multiarch.yml @@ -0,0 +1,80 @@ +name: Build and publish multiarch +on: + push: + branches: + - multiarch + - java8-multiarch + - multiarch-latest + - java15 + - test/multiarch/* + tags: + - "[0-9]+.[0-9]+.[0-9]+-multiarch" + - "[0-9]+.[0-9]+.[0-9]+-multiarch-latest" + - "[0-9]+.[0-9]+.[0-9]+-java15" + +jobs: + docker-buildx: + runs-on: ubuntu-20.04 + steps: + - name: Checkout + uses: actions/checkout@v2.2.0 + + - name: Prepare + id: prep + run: | + DOCKER_IMAGE=itzg/minecraft-server + VERSION=edge + if [[ $GITHUB_REF == refs/tags/* ]]; then + VERSION=${GITHUB_REF#refs/tags/} + fi + if [[ $GITHUB_REF == refs/heads/* ]]; then + VERSION=${GITHUB_REF#refs/heads/} + if [[ $VERSION == master ]]; then + VERSION=latest + fi + fi + TAGS="${DOCKER_IMAGE}:${VERSION//\//-}" + echo ::set-output name=tags::${TAGS} + echo ::set-output name=cache_from::${TAGS} + echo ::set-output name=version::${VERSION//\//-} + echo ::set-output name=cache_version::${VERSION//\//-} + + - name: Setup Docker Buildx + uses: docker/setup-buildx-action@v1 + + - name: Cache Docker layers + uses: actions/cache@v2 + 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 + + - name: Login to DockerHub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKER_USER }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Build and push + id: docker_build + uses: docker/build-push-action@v2 + with: + context: . + file: ./Dockerfile + platforms: linux/amd64,linux/arm/v7,linux/arm64 + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.prep.outputs.tags }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + labels: | + org.opencontainers.image.documentation=https://github.com/itzg/docker-minecraft-server + org.opencontainers.image.source=https://github.com/itzg/docker-minecraft-server + org.opencontainers.image.version=${{ steps.prep.outputs.version }} + org.opencontainers.image.revision=${{ github.sha }} + + - name: Image digest + run: echo ${{ steps.docker_build.outputs.digest }} diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e84e0868..867138b5 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -7,11 +7,7 @@ on: - java8 - openj9 - openj9-11 - - openj9-nightly - adopt11 - - adopt13 - - adopt14 - - adopt15 - test/* tags: - "[0-9]+.[0-9]+.[0-9]+" @@ -20,9 +16,6 @@ on: - "[0-9]+.[0-9]+.[0-9]+-openj9-11" - "[0-9]+.[0-9]+.[0-9]+-openj9-nightly" - "[0-9]+.[0-9]+.[0-9]+-adopt11" - - "[0-9]+.[0-9]+.[0-9]+-adopt13" - - "[0-9]+.[0-9]+.[0-9]+-adopt14" - - "[0-9]+.[0-9]+.[0-9]+-adopt15" jobs: test: diff --git a/Dockerfile b/Dockerfile index c21bbd0a..9cf2b045 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM openjdk:8u212-jre-alpine +FROM adoptopenjdk/openjdk11:alpine-jre LABEL org.opencontainers.image.authors="Geoff Bourne " diff --git a/README.md b/README.md index 40546e29..0f0007af 100644 --- a/README.md +++ b/README.md @@ -158,27 +158,33 @@ the server jar remain in the `/data` directory. It is safe to remove those._ ## Running Minecraft server on different Java version -To use a different version of Java, please use a docker tag to run your Minecraft server, where the tag is appended to the image such as `itzg/minecraft-server:TAG_NAME`. +To use a different version of Java, please use a docker tag to run your Minecraft server. -| Tag name | Description | Linux | -| -------------- | ------------------------------------------- | ------------ | -| latest | **Default**. Uses Java version 8 | Alpine Linux | -| java8 | Uses Java 8 for Forge mod compatibility | Alpine Linux | -| adopt15 | Uses Java version 15 from AdoptOpenJDK | Alpine Linux | -| adopt14 | Uses Java version 14 from AdoptOpenJDK | Alpine Linux | -| adopt13 | Uses Java version 13 from AdoptOpenJDK | Alpine Linux | -| adopt11 | Uses Java version 11 from AdoptOpenJDK | Alpine Linux | -| openj9 | Uses Eclipse OpenJ9 JVM | Alpine Linux | -| openj9-11 | Uses Eclipse OpenJ9 JVM for Java 11 | Alpine Linux | -| openj9-nightly | Uses Eclipse OpenJ9 JVM testing builds | Alpine Linux | -| multiarch | Uses Java version 8 | Debian Linux | -| multiarch-latest | Uses Java version 15 latest update | Debian Linux | +| Tag name | Java version | Linux | JVM Type | Architecture | +| -------------- | -------------|--------|----------|-------------------| +| latest | 11 | Alpine | Hotspot | amd64 | +| java8 | 8 | Alpine | Hotspot | amd64 | +| java8-multiarch | 8 | Debian | Hotspot | amd64,arm64,armv7 | +| java15 | 15 | Debian | Hotspot | amd64,arm64,armv7 | +| adopt11 | 11 | Alpine | Hotspot | amd64 | +| openj9 | 8 | Alpine | OpenJ9 | amd64 | +| openj9-11 | 11 | Alpine | OpenJ9 | amd64 | +| multiarch | 11 | Debian | Hotspot | amd64,arm64,armv7 | +| multiarch-latest | 15+ | Debian | Hotspot | amd64,arm64,armv7 | -For example, to use a Java version 13: +For example, to use Java version 15 on any supported architecture: - docker run --name mc itzg/minecraft-server:adopt13 + docker run --name mc itzg/minecraft-server:java15 -Keep in mind that some versions of Minecraft server can't work on the newest versions of Java. Also, FORGE doesn't support openj9 JVM implementation. +> Keep in mind that some versions of Minecraft server can't work on the newest versions of Java. Also, FORGE doesn't support openj9 JVM implementation. + +### Deprecated Image Tags + +The following image tags have been deprecated and are no longer receiving updates: +- adopt13 +- adopt14 +- adopt15 +- openj9-nightly ## Healthcheck @@ -509,7 +515,7 @@ A [Catserver](http://catserver.moe/) type server can be used with ## Running a server with a Feed the Beast modpack -> **NOTE** requires `itzg/minecraft-server:multiarch` image +> **NOTE** requires one of the Debian based images listed in [the Java versions section](#running-minecraft-server-on-different-java-version). [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. @@ -959,7 +965,7 @@ environment variable set to `false`, such as ### Level Type and Generator Settings By default, a standard world is generated with hills, valleys, water, etc. A different level type can -be configured by setting `LEVEL_TYPE` to an expected type, such as +be configured by setting `LEVEL_TYPE` to an expected type, for example - DEFAULT - FLAT @@ -967,6 +973,8 @@ be configured by setting `LEVEL_TYPE` to an expected type, such as - AMPLIFIED - CUSTOMIZED - BUFFET +- BIOMESOP (Biomes O' Plenty for 1.12 and older) +- BIOMESOPLENTY (Biomes O' Plenty for 1.15 and above) Descriptions are available at the [gamepedia](http://minecraft.gamepedia.com/Server.properties). @@ -1097,19 +1105,18 @@ is passed to `docker run`. ### Memory Limit -By default, the image declares a Java initial and maximum memory limit of 1 GB. There are several -ways to adjust the memory settings: +By default, the image declares an initial and maximum Java memory-heap limit of 1 GB. There are several ways to adjust the memory settings: -- `MEMORY`, "1G" by default, can be used to adjust both initial (`Xms`) and max (`Xmx`) - memory settings of the JVM -- `INIT_MEMORY`, independently sets the initial heap size -- `MAX_MEMORY`, independently sets the max heap size +- `MEMORY`: "1G" by default, can be used to adjust both initial (`Xms`) and max (`Xmx`) memory heap settings of the JVM +- `INIT_MEMORY`: independently sets the initial heap size +- `MAX_MEMORY`: independently sets the max heap size -The values of all three are passed directly to the JVM and support format/units as -`[g|G|m|M|k|K]`. For example: +The values of all three are passed directly to the JVM and support format/units as `[g|G|m|M|k|K]`. For example: -e MEMORY=2G +> NOTE: the settings above only set the Java **heap** limits. Memory resource requests and limits on the overall container should also account for non-heap memory usage. An extra 25% is [a general best practice](https://dzone.com/articles/best-practices-java-memory-arguments-for-container). + ### JVM Options General JVM options can be passed to the Minecraft Server invocation by passing a `JVM_OPTS` diff --git a/docker-versions-create.sh b/docker-versions-create.sh index 6e3a27d8..93c4a9d6 100755 --- a/docker-versions-create.sh +++ b/docker-versions-create.sh @@ -1,7 +1,7 @@ #!/bin/bash #set -x # Use this variable to indicate a list of branches that docker hub is watching -branches_list=('forge' 'openj9' 'openj9-11' 'openj9-nightly' 'adopt11' 'adopt13' 'adopt14' 'adopt15' 'multiarch' 'multiarch-latest') +branches_list=('java8' 'java8-multiarch' 'openj9' 'openj9-11' 'adopt11' 'java15' 'multiarch' 'multiarch-latest') function TrapExit { echo "Checking out back in master"