P
描述
Pocketmine 服务端镜像 由 swisscrafting.ch 的 onekintaro 制作 感谢 Pelican Discord 的 #eggs 频道提供的热心帮助 :)
58 浏览
7 下载
2026-06-30
更新于 3 天前
预设配置详情
registry.cn-shanghai.aliyuncs.com/pterodactyl-images/yolks:debian
./bin/php7/bin/php ./PocketMine-MP.phar --no-wizard
| 变量名 | 变量 | 描述 | 默认值 | 规则 | 可查看 | 可编辑 |
|---|---|---|---|---|---|---|
| 要安装的版本 | VERSION |
要安装的最新PocketMine版本。 | PM5PHP83 |
required|string|in:PM5,PM5PHP83,PM5PHP84,PM4
必填 字符串 选项: PM5,PM5PHP83,PM5PHP84,PM4
|
镜像
registry.cn-shanghai.aliyuncs.com/pterodactyl-images/installers:debian
入口
bash
#!/bin/bash
apt-get update
apt-get install -y git curl wget jq file tar unzip zip
mkdir -p /mnt/server/ # Not required. Only here for parkervcp's local test setup
cd /mnt/server || exit 1
ARCH=$([[ "$(uname -m)" == "x86_64" ]] && printf "x86_64" || printf "arm64")
# Shouldn't be possible to be empty, but default to PM5 if it is and convert to uppercase
VERSION="${VERSION:-PM5}"
VERSION="${VERSION^^}"
# Helper functions
download_php_binary() {
local php_binary_url
if [[ "$VERSION" == "PM5" ]]; then
php_binary_url="https://github.com/pmmp/PHP-Binaries/releases/download/pm5-latest/PHP-8.2-Linux-${ARCH}-PM5.tar.gz"
elif [[ "$VERSION" == "PM5PHP83" ]]; then
php_binary_url="https://github.com/pmmp/PHP-Binaries/releases/download/pm5-php-8.3-latest/PHP-8.3-Linux-${ARCH}-PM5.tar.gz"
elif [[ "$VERSION" == "PM5PHP84" ]]; then
php_binary_url="https://github.com/pmmp/PHP-Binaries/releases/download/pm5-php-8.4-latest/PHP-8.4-Linux-${ARCH}-PM5.tar.gz"
elif [[ "$VERSION" == "PM4" ]]; then
php_binary_url="https://github.com/pmmp/PHP-Binaries/releases/download/pm4-latest/PHP-8.1-Linux-${ARCH}-PM4.tar.gz"
else
printf "Unsupported version: %s
" "${VERSION}"
exit 1
fi
printf "Downloading PHP binary for %s from %s
" "$VERSION" "$php_binary_url"
curl --location --progress-bar "$php_binary_url" | tar -xzv
}
set_php_extension_dir() {
printf "Configuring php.ini
"
EXTENSION_DIR=$(find "bin" -name '*debug-zts*')
grep -q '^extension_dir' bin/php7/bin/php.ini && \
sed -i'bak' "s{^extension_dir=.*{extension_dir=\"$EXTENSION_DIR\"{" bin/php7/bin/php.ini || \
echo "extension_dir=\"$EXTENSION_DIR\"" >>bin/php7/bin/php.ini
}
download_pmmp() {
DOWNLOAD_LINK=$(curl -sSL https://update.pmmp.io/api?channel="$API_CHANNEL" | jq -r '.download_url')
printf "Downloading %s from %s
" "$VERSION" "${DOWNLOAD_LINK}"
curl --location --progress-bar "${DOWNLOAD_LINK}" --output PocketMine-MP.phar
}
# We have to convert VERSION into an API channel
if [[ "${VERSION}" == "PM4" ]]; then
API_CHANNEL="4"
elif [[ "${VERSION}" == "PM5" ]] || [[ "${VERSION}" == "PM5PHP83" ]] || [[ "${VERSION}" == "PM5PHP84" ]]; then
API_CHANNEL="stable"
else
printf "Unsupported version: %s
" "${VERSION}"
exit 1
fi
REQUIRED_PHP_VERSION=$(curl -sSL https://update.pmmp.io/api?channel="$API_CHANNEL" | jq -r '.php_version')
if [[ "${ARCH}" == "x86_64" ]]; then
download_php_binary
# There are no ARM64 PHP binaries yet, so we have to compile them
else
apt-get install -y make autoconf automake m4 bzip2 bison g++ cmake pkg-config re2c libtool-bin
mkdir -p /mnt/server/build_cache/archives
mkdir -p /mnt/server/build_cache/compilation
# Each PHP version has its own compile script, so we have to download the correct one
echo "Running curl to download compile.sh for PHP version $REQUIRED_PHP_VERSION"
curl --location --progress-bar --remote-name https://raw.githubusercontent.com/pmmp/PHP-Binaries/latest/compile.sh
chmod +x compile.sh
cat <<EOF
----------------------------------------
| |
| Compiling PHP Binary for ARM64 |
| |
| This is a time consuming process |
----------------------------------------
EOF
printf "
Compiling PHP binary, this is a slow process and will take time
"
THREADS=$(grep -c ^processor /proc/cpuinfo) || THREADS=1
./compile.sh -j "${THREADS}" -c /mnt/server/build_cache/archives -l /mnt/server/build_cache/compilation -z "${REQUIRED_PHP_VERSION}"
rm compile.sh
rm -rf install_data/
fi
# Steps below are the same for both architectures
download_pmmp
set_php_extension_dir || exit 1
if [[ ! -f server.properties ]]; then
printf "Downloading default server.properties template
"
curl --location --progress-bar --remote-name https://raw.githubusercontent.com/parkervcp/eggs/master/game_eggs/minecraft/bedrock/pocketmine_mp/server.properties
fi
printf "Creating default file and folder structure
"
touch banned-ips.txt banned-players.txt ops.txt white-list.txt server.log
mkdir -p players worlds plugins resource_packs
cat <<EOF
----------------------------------------
| |
| PocketMine-MP Installation Done |
| |
----------------------------------------
EOF
{
"_comment": "DO NOT EDIT: FILE GENERATED AUTOMATICALLY BY PTERODACTYL PANEL - PTERODACTYL.IO",
"meta": {
"version": "PTDL_v2",
"update_url": "https://eggs.pterodactyl.top/eggs/149/download/egg-pocketminemp.json"
},
"exported_at": "2025-12-06T14:24:50+00:00",
"name": "PocketmineMP",
"author": "info@swisscrafting.ch",
"description": "Pocketmine 服务端镜像\n由 swisscrafting.ch 的 onekintaro 制作\n感谢 Pelican Discord 的 #eggs 频道提供的热心帮助 :)",
"features": null,
"docker_images": {
"registry.cn-shanghai.aliyuncs.com/pterodactyl-images/yolks:debian": "registry.cn-shanghai.aliyuncs.com/pterodactyl-images/yolks:debian"
},
"file_denylist": [],
"startup": "./bin/php7/bin/php ./PocketMine-MP.phar --no-wizard",
"image": null,
"config": {
"files": "{\n \"server.properties\": {\n \"parser\": \"properties\",\n \"find\": {\n \"server-ip\": \"0.0.0.0\",\n \"enable-query\": \"true\",\n \"server-port\": \"{{server.build.default.port}}\",\n \"query.port\": \"{{server.build.default.port}}\"\n }\n }\n}",
"startup": "{\n \"done\": \")! \"\n}",
"logs": "{}",
"stop": "stop"
},
"scripts": {
"installation": {
"script": "#!/bin/bash\n\napt-get update\napt-get install -y git curl wget jq file tar unzip zip\n\nmkdir -p /mnt/server/ # Not required. Only here for parkervcp's local test setup\n\ncd /mnt/server || exit 1\n\nARCH=$([[ \"$(uname -m)\" == \"x86_64\" ]] && printf \"x86_64\" || printf \"arm64\")\n\n# Shouldn't be possible to be empty, but default to PM5 if it is and convert to uppercase\nVERSION=\"${VERSION:-PM5}\"\nVERSION=\"${VERSION^^}\"\n\n# Helper functions\n\ndownload_php_binary() {\n local php_binary_url\n if [[ \"$VERSION\" == \"PM5\" ]]; then\n php_binary_url=\"https://github.com/pmmp/PHP-Binaries/releases/download/pm5-latest/PHP-8.2-Linux-${ARCH}-PM5.tar.gz\"\n elif [[ \"$VERSION\" == \"PM5PHP83\" ]]; then\n php_binary_url=\"https://github.com/pmmp/PHP-Binaries/releases/download/pm5-php-8.3-latest/PHP-8.3-Linux-${ARCH}-PM5.tar.gz\"\n elif [[ \"$VERSION\" == \"PM5PHP84\" ]]; then\n php_binary_url=\"https://github.com/pmmp/PHP-Binaries/releases/download/pm5-php-8.4-latest/PHP-8.4-Linux-${ARCH}-PM5.tar.gz\" \n elif [[ \"$VERSION\" == \"PM4\" ]]; then\n php_binary_url=\"https://github.com/pmmp/PHP-Binaries/releases/download/pm4-latest/PHP-8.1-Linux-${ARCH}-PM4.tar.gz\"\n else\n printf \"Unsupported version: %s\\n\" \"${VERSION}\"\n exit 1\n fi\n\n printf \"Downloading PHP binary for %s from %s\\n\" \"$VERSION\" \"$php_binary_url\"\n curl --location --progress-bar \"$php_binary_url\" | tar -xzv\n}\n\nset_php_extension_dir() {\n printf \"Configuring php.ini\\n\"\n EXTENSION_DIR=$(find \"bin\" -name '*debug-zts*')\n grep -q '^extension_dir' bin/php7/bin/php.ini && \\\n sed -i'bak' \"s{^extension_dir=.*{extension_dir=\\\"$EXTENSION_DIR\\\"{\" bin/php7/bin/php.ini || \\\n echo \"extension_dir=\\\"$EXTENSION_DIR\\\"\" >>bin/php7/bin/php.ini\n}\n\ndownload_pmmp() {\n DOWNLOAD_LINK=$(curl -sSL https://update.pmmp.io/api?channel=\"$API_CHANNEL\" | jq -r '.download_url')\n printf \"Downloading %s from %s\\n\" \"$VERSION\" \"${DOWNLOAD_LINK}\"\n curl --location --progress-bar \"${DOWNLOAD_LINK}\" --output PocketMine-MP.phar\n}\n\n# We have to convert VERSION into an API channel\nif [[ \"${VERSION}\" == \"PM4\" ]]; then\n API_CHANNEL=\"4\"\nelif [[ \"${VERSION}\" == \"PM5\" ]] || [[ \"${VERSION}\" == \"PM5PHP83\" ]] || [[ \"${VERSION}\" == \"PM5PHP84\" ]]; then\n API_CHANNEL=\"stable\"\nelse\n printf \"Unsupported version: %s\\n\" \"${VERSION}\"\n exit 1\nfi\n\nREQUIRED_PHP_VERSION=$(curl -sSL https://update.pmmp.io/api?channel=\"$API_CHANNEL\" | jq -r '.php_version')\n\nif [[ \"${ARCH}\" == \"x86_64\" ]]; then\n download_php_binary\n\n# There are no ARM64 PHP binaries yet, so we have to compile them\nelse\n apt-get install -y make autoconf automake m4 bzip2 bison g++ cmake pkg-config re2c libtool-bin\n \n mkdir -p /mnt/server/build_cache/archives\n mkdir -p /mnt/server/build_cache/compilation\n \n # Each PHP version has its own compile script, so we have to download the correct one\n echo \"Running curl to download compile.sh for PHP version $REQUIRED_PHP_VERSION\"\n curl --location --progress-bar --remote-name https://raw.githubusercontent.com/pmmp/PHP-Binaries/latest/compile.sh\n chmod +x compile.sh\n\n cat <<EOF\n----------------------------------------\n| |\n| Compiling PHP Binary for ARM64 |\n| |\n| This is a time consuming process |\n----------------------------------------\nEOF\n\n printf \"\\n\\nCompiling PHP binary, this is a slow process and will take time\\n\"\n THREADS=$(grep -c ^processor /proc/cpuinfo) || THREADS=1\n ./compile.sh -j \"${THREADS}\" -c /mnt/server/build_cache/archives -l /mnt/server/build_cache/compilation -z \"${REQUIRED_PHP_VERSION}\"\n rm compile.sh\n rm -rf install_data/\n\nfi\n\n# Steps below are the same for both architectures\ndownload_pmmp\nset_php_extension_dir || exit 1\n\nif [[ ! -f server.properties ]]; then\n printf \"Downloading default server.properties template\\n\"\n curl --location --progress-bar --remote-name https://raw.githubusercontent.com/parkervcp/eggs/master/game_eggs/minecraft/bedrock/pocketmine_mp/server.properties\nfi\n\nprintf \"Creating default file and folder structure\\n\"\ntouch banned-ips.txt banned-players.txt ops.txt white-list.txt server.log\nmkdir -p players worlds plugins resource_packs\n\ncat <<EOF\n----------------------------------------\n| |\n| PocketMine-MP Installation Done |\n| |\n----------------------------------------\nEOF",
"container": "registry.cn-shanghai.aliyuncs.com/pterodactyl-images/installers:debian",
"entrypoint": "bash"
}
},
"variables": [
{
"name": "要安装的版本",
"description": "要安装的最新PocketMine版本。",
"env_variable": "VERSION",
"default_value": "PM5PHP83",
"user_viewable": true,
"user_editable": true,
"rules": "required|string|in:PM5,PM5PHP83,PM5PHP84,PM4",
"field_type": "text"
}
]
}附属文件
暂无附属文件
提交历史
Fork 关系
查看关系图暂无 Fork,成为第一个 Fork 的人吧!
统计
58
浏览
7
下载
0
星标
0
复刻
作者
飒
飒爽师叔
UID: 1
279 预设
·
2026-06