Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

#github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
github: itzg
custom:
- https://www.buymeacoffee.com/itzg
- https://paypal.me/itzg
28 changes: 20 additions & 8 deletions .github/workflows/build-multiarch.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and publish multiarch
name: Test and Build multi-architecture
on:
push:
branches:
Expand All @@ -10,6 +10,13 @@ on:
- "*.md"
- "docs/**"
- "examples/**"
pull_request:
branches: [ master ]
types: [assigned, opened, synchronize, labeled]
paths-ignore:
- "*.md"
- "docs/**"
- "examples/**"

jobs:
build:
Expand Down Expand Up @@ -120,12 +127,6 @@ jobs:
- name: Set up QEMU
uses: docker/setup-qemu-action@v2.0.0

- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build for test
uses: docker/build-push-action@v3.0.0
with:
Expand All @@ -149,12 +150,23 @@ jobs:
run: |
tests/test.sh

- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build and push
id: docker_build
uses: docker/build-push-action@v3.0.0
with:
platforms: ${{ matrix.platforms }}
push: ${{ github.ref_type == 'tag' || github.ref_name == 'master' }}
push: >
${{
github.ref_type == 'tag'
|| github.ref_name == 'master'
|| ( github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'ci/push-image') )
}}
tags: ${{ steps.meta.outputs.tags }}
# ensure latest base image is used
pull: true
Expand Down
73 changes: 0 additions & 73 deletions .github/workflows/pr.yml

This file was deleted.

4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
--var version=0.1.1 --var app=maven-metadata-release --file {{.app}} \
--from https://github.com/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz

ARG MC_HELPER_VERSION=1.19.0
ARG MC_HELPER_VERSION=1.20.1
ARG MC_HELPER_BASE_URL=https://github.com/itzg/mc-image-helper/releases/download/v${MC_HELPER_VERSION}
RUN curl -fsSL ${MC_HELPER_BASE_URL}/mc-image-helper-${MC_HELPER_VERSION}.tgz \
| tar -C /usr/share -zxf - \
Expand All @@ -72,4 +72,4 @@ COPY --chmod=755 files/rconcmds /rconcmds
RUN dos2unix /start* /autopause/* /autostop/* /rconcmds/*

ENTRYPOINT [ "/start" ]
HEALTHCHECK --start-period=1m CMD mc-health
HEALTHCHECK --start-period=1m --interval=5s --retries=24 CMD mc-health
14 changes: 11 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -235,9 +235,7 @@ An image that dockerizes [rcon-web-admin](https://github.com/rcon-web-admin/rcon

## Healthcheck

This image contains [mc-monitor](https://github.com/itzg/mc-monitor) and uses
its `status` command to continually check on the container's. That can be observed
from the `STATUS` column of `docker ps`
This image contains [mc-monitor](https://github.com/itzg/mc-monitor) and uses its `status` command to continually check on the container's. That can be observed from the `STATUS` column of `docker ps`

```
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
Expand All @@ -251,6 +249,16 @@ You can also query the container's health in a script friendly way:
healthy
```

There's actually a wrapper script called `mc-health` that takes care of calling `mc-monitor status` with the correct arguments. If needing to customize the health checks parameters, such as in a compose file, then use something like the following in the service declaration:

```yaml
healthcheck:
test: mc-health
start_period: 1m
interval: 5s
retries: 20
```

Some orchestration systems, such as Portainer, don't allow for disabling the default `HEALTHCHECK` declared by this image. In those cases you can approximate the disabling of healthchecks by setting the environment variable `DISABLE_HEALTHCHECK` to `true`.

## Deployment Templates and Examples
Expand Down
11 changes: 8 additions & 3 deletions scripts/start-deployPaper
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
#!/bin/bash

. ${SCRIPTS:-/}start-utils
# shellcheck source=start-utils
. "${SCRIPTS:-/}start-utils"
set -o pipefail
isDebugging && set -x
handleDebugMode

: "${PAPER_CUSTOM_JAR:=}"

ourScript="$0"
ourArgs=("$@")
Expand All @@ -28,7 +31,9 @@ function handleMissingVersion() {
exit 1
}

if [[ $PAPER_DOWNLOAD_URL ]]; then
if [[ $PAPER_CUSTOM_JAR ]]; then
export SERVER="$PAPER_CUSTOM_JAR"
elif [[ $PAPER_DOWNLOAD_URL ]]; then
export SERVER=$(getFilenameFromUrl "${PAPER_DOWNLOAD_URL}")

if [ -f "$SERVER" ]; then
Expand Down
8 changes: 5 additions & 3 deletions scripts/start-setupModpack
Original file line number Diff line number Diff line change
Expand Up @@ -235,10 +235,12 @@ function genericPacks() {
done

# recalculate the actual base directory of content
base_dir=$(find "$base_dir" -maxdepth 3 -type d \( -name mods -o -name plugins -o -name config \) -printf '%h\n' | awk '{ print length;print $0 }' | sort -n -s | cut -d" " -f2- | head -n1 | xargs echo -n)
if [[ ! $base_dir ]]; then
if ! base_dir=$(mc-image-helper find \
--max-depth=3 --type=directory --name=mods,plugins,config \
--only-shallowest --fail-no-matches --format '%h' \
"$base_dir"); then
log "ERROR: Unable to find content base of generic packs ${GENERIC_PACKS}. Directories:"
find $original_base_dir -maxdepth 3 -type d -printf ' - %P\n'
mc-image-helper find --name=* --max-depth=3 --type=directory --format '- %P' "$original_base_dir"
exit 1
fi

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,13 @@ services:
environment:
EULA: "TRUE"
SETUP_ONLY: "TRUE"
VERSION: ${MINECRAFT_VERSION:-LATEST}
WORLD: /worlds/world-for-testing.zip
# the following are only used to speed up test execution
TYPE: CUSTOM
CUSTOM_SERVER: /servers/fake.jar
VERSION: 1.18.1
volumes:
- ./worlds:/worlds:ro
- ./data:/data
# the following are only used to speed up test execution
- ./verify.sh:/servers/fake.jar
2 changes: 1 addition & 1 deletion tests/setuponlytests/forgeapimods_file/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ services:
CUSTOM_SERVER: /servers/fake.jar
VERSION: 1.18.2
MODS_FORGEAPI_FILE: /config/forgeapi_mods.json
# Key is defined in .github/workflows/pr.yml and ci.yml
# Key is passed by Github Workflow
# This should be coming from github secrets.
MODS_FORGEAPI_KEY: ${MODS_FORGEAPI_KEY}
REMOVE_OLD_FORGEAPI_MODS: "TRUE"
Expand Down
6 changes: 6 additions & 0 deletions tests/setuponlytests/generic-packs-prefix/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ services:
GENERIC_PACKS_PREFIX: /packs/
GENERIC_PACKS_SUFFIX: .zip
DEBUG: "true"
# the following are only used to speed up test execution
TYPE: CUSTOM
CUSTOM_SERVER: /servers/fake.jar
VERSION: 1.18.1
volumes:
- ./packs:/packs
- ./data:/data
# the following are only used to speed up test execution
- ./verify.sh:/servers/fake.jar
7 changes: 6 additions & 1 deletion tests/setuponlytests/ops_from_scratch/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@ services:
environment:
EULA: "TRUE"
SETUP_ONLY: "TRUE"
VERSION: ${MINECRAFT_VERSION:-LATEST}
OPS: itzg
# the following are only used to speed up test execution
TYPE: CUSTOM
CUSTOM_SERVER: /servers/fake.jar
VERSION: 1.18.1
volumes:
- ./data:/data
# the following are only used to speed up test execution
- ./verify.sh:/servers/fake.jar
2 changes: 2 additions & 0 deletions tests/setuponlytests/spiget/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ services:
EULA: "TRUE"
SETUP_ONLY: "TRUE"
TYPE: PAPER
# jar doesn't need to exist for setuponly tests
PAPER_CUSTOM_JAR: /servers/fake.jar
SPIGET_RESOURCES: "34315,3836,6245,2124"
volumes:
- ./data:/data
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@ services:
environment:
EULA: "TRUE"
SETUP_ONLY: "TRUE"
VERSION: ${MINECRAFT_VERSION:-LATEST}
TYPE: "PAPER"
WORLD: /worlds/world-for-testing.zip
# the following are only used to speed up test execution
VERSION: 1.18.1
PAPER_CUSTOM_JAR: /servers/fake.jar
volumes:
- ./worlds:/worlds:ro
- ./data:/data
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,13 @@ services:
environment:
EULA: "TRUE"
SETUP_ONLY: "TRUE"
VERSION: ${MINECRAFT_VERSION:-LATEST}
WORLD: /worlds/world-for-testing.zip
# the following are only used to speed up test execution
TYPE: CUSTOM
CUSTOM_SERVER: /servers/fake.jar
VERSION: 1.18.1
volumes:
- ./worlds:/worlds:ro
- ./data:/data
# the following are only used to speed up test execution
- ./verify.sh:/servers/fake.jar
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@ services:
environment:
EULA: "TRUE"
SETUP_ONLY: "TRUE"
VERSION: ${MINECRAFT_VERSION:-LATEST}
TYPE: "PAPER"
WORLD: /worlds/world-for-testing.zip
# the following are only used to speed up test execution
VERSION: 1.18.1
PAPER_CUSTOM_JAR: /servers/fake.jar
volumes:
- ./worlds:/worlds:ro
- ./data:/data
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,13 @@ services:
environment:
EULA: "TRUE"
SETUP_ONLY: "TRUE"
VERSION: ${MINECRAFT_VERSION:-LATEST}
WORLD: /worlds/world-for-testing.zip
# the following are only used to speed up test execution
TYPE: CUSTOM
CUSTOM_SERVER: /servers/fake.jar
VERSION: 1.18.1
volumes:
- ./worlds:/worlds:ro
- ./data:/data
# the following are only used to speed up test execution
- ./verify.sh:/servers/fake.jar
9 changes: 6 additions & 3 deletions tests/setuponlytests/vanillatweaks_file/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,17 @@ services:
restart: "no"
image: ${IMAGE_TO_TEST:-itzg/minecraft-server}
environment:
VANILLATWEAKS_FILE: /config/vt-datapacks.json,/config/vt-craftingtweaks.json,/config/vt-resourcepacks.json
EULA: "TRUE"
SETUP_ONLY: "TRUE"
# the following are only used to speed up test execution
TYPE: CUSTOM
CUSTOM_SERVER: /servers/fake.jar
VANILLATWEAKS_FILE: /config/vt-datapacks.json,/config/vt-craftingtweaks.json,/config/vt-resourcepacks.json
REMOVE_OLD_VANILLATWEAKS: "FALSE"
VERSION: 1.18.1
volumes:
- ./data:/data
- ./vt-datapacks.json:/config/vt-datapacks.json:ro
- ./vt-craftingtweaks.json:/config/vt-craftingtweaks.json:ro
- ./vt-resourcepacks.json:/config/vt-resourcepacks.json:ro
- ./fake.jar:/servers/fake.jar
# the following are only used to speed up test execution
- ./verify.sh:/servers/fake.jar
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,14 @@ services:
restart: "no"
image: ${IMAGE_TO_TEST:-itzg/minecraft-server}
environment:
VANILLATWEAKS_SHARECODE: MGr52E,tF1zL2,LnEDwT
EULA: "TRUE"
SETUP_ONLY: "TRUE"
# the following are only used to speed up test execution
TYPE: CUSTOM
CUSTOM_SERVER: /servers/fake.jar
VANILLATWEAKS_SHARECODE: MGr52E,tF1zL2,LnEDwT
VERSION: 1.18.1
volumes:
- ./data:/data
- ./fake.jar:/servers/fake.jar
# the following are only used to speed up test execution
- ./verify.sh:/servers/fake.jar
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,14 @@ services:
environment:
EULA: "TRUE"
SETUP_ONLY: "TRUE"
VERSION: ${MINECRAFT_VERSION:-LATEST}
WHITELIST: itzg
ENFORCE_WHITELIST: "true"
OVERRIDE_SERVER_PROPERTIES: "true"
# the following are only used to speed up test execution
TYPE: CUSTOM
CUSTOM_SERVER: /servers/fake.jar
VERSION: 1.18.1
volumes:
- ./data:/data
# the following are only used to speed up test execution
- ./verify.sh:/servers/fake.jar
Loading