From adc2bbf5ffcaf4f1aca9ea8e376ec1fa0fcf91eb Mon Sep 17 00:00:00 2001 From: Eric-Meier Date: Tue, 22 Sep 2026 06:04:39 -0600 Subject: [PATCH] Add ability to use any remote console port when using network mode host (#683) --- README.md | 3 ++- bedrock-entry.sh | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 7559380..03a967b 100644 --- a/README.md +++ b/README.md @@ -71,7 +71,8 @@ For Minecraft Java Edition you'll need to use this image instead: - `PACKAGE_BACKUP_KEEP` (`2`) : how many package backups to keep - `DIRECT_DOWNLOAD_URL` (no default): This environment variable can be used to provide a **direct download URL** for the Minecraft Bedrock server `.zip` file. When set, this URL will be used instead of attempting to automatically look up the download link from `minecraft.net`. This is particularly useful for CI/CD environments or when the automatic version lookup is temporarily broken due to website changes. Ensure the URL points directly to the `bedrock-server-VERSION.zip` file. - `DOWNLOAD_PROGRESS` (default is `false`) : When set to `true`, displays a progress bar during the Bedrock server download instead of running silently. -- `ENABLE_SSH` (default is `false`) : Enable remote console over SSH on port 2222 if this environment variable is set to `true`. +- `ENABLE_SSH` (default is `false`) : Enable remote console over SSH on 2222 (or `REMOTE_CONSOLE_BIND_ADDRESS` if provided) if this environment variable is set to `true`. +- `REMOTE_CONSOLE_BIND_ADDRESS` (default is :2222) : Set the address to bind to for SSH remote console. - `ENABLE_BDS_V6BIND_FIX` (default is `false`) : allows `SERVER_PORT` and `SERVER_PORT_V6` to be set to the same port. See [IPv6 same-port fix](#ipv6-same-port-fix). Enabling it should mitigate connectivity issues in dual-stack setups. - `MC_PACK` (no default): Path inside the container to a single archive file (e.g. `.mcpack`, `.mcworld`, `.mctemplate`, `.mcaddon`, or any zip) or to a directory with the same layout. At startup the archive is unpacked (or the directory is read): top-level `behavior_packs/` is merged into `behavior_packs/`, top-level `resource_packs/` into `resource_packs/`, and all other content (when `level.dat` is present) into `worlds/{LEVEL_NAME}`. For `.mcaddon` archives, which use root-level `data/` (behavior) and `resources/` (resource) folders instead of `behavior_packs/` and `resource_packs/`, these are detected and installed automatically using the pack UUID from each manifest as the folder name. - `FORCE_WORLD_COPY` (default `false`): When `MC_PACK` contains a world (`level.dat`), set to `true` to remove and replace the existing `worlds/{LEVEL_NAME}` on every startup; otherwise the world is copied only when it does not exist. diff --git a/bedrock-entry.sh b/bedrock-entry.sh index 144a1f2..3a689e6 100755 --- a/bedrock-entry.sh +++ b/bedrock-entry.sh @@ -497,6 +497,9 @@ fi mcServerRunnerArgs=() if isTrue "${ENABLE_SSH}"; then mcServerRunnerArgs+=(--remote-console) + if [[ -v REMOTE_CONSOLE_BIND_ADDRESS ]]; then + mcServerRunnerArgs+=(--remote-console-bind-address "${REMOTE_CONSOLE_BIND_ADDRESS}") + fi if ! [[ -v RCON_PASSWORD ]]; then RCON_PASSWORD=$(openssl rand -hex 12) export RCON_PASSWORD