Alpine 中安装 1Panel 面板
Alpine直接安装1Panel面板会提示系统不支持,但是1Panel面板 其实就是docker运行的,故可以手动安装docker组件,解决系统程序问题后,就可以直接安装1Panel面板了。
1.修改为国内源
XML/HTML代码
- sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories
- sed -i 's/#http/http/g' /etc/apk/repositories
- apk update && apk upgrade
2.安装一些必要的组件
XML/HTML代码
- apk add bash curl nano docker docker-cli-compose
- rc-service docker start
- rc-update add docker
3.将 systemctl 转译为 OpenRC,保存
nano /usr/local/bin/systemctl
XML/HTML代码
- #!/bin/sh
- action=${1}
- service=$(echo ${2} | sed 's/\.\(service\|socket\)//g')
- # Helper function to print usage
- print_usage() {
- echo "Unsupported systemctl command: ${action}"
- echo "Supported commands: start, stop, restart, reload, status, enable, disable, is-enabled, is-active, show, list-units"
- exit 1
- }
- case "${action}" in
- start)
- rc-service "${service}" start
- ;;
- stop)
- rc-service "${service}" stop
- ;;
- restart)
- rc-service "${service}" restart
- ;;
- reload)
- rc-service "${service}" reload || echo "Service ${service} does not support reload; attempting restart" && rc-service "${service}" restart
- ;;
- daemon-reload)
- return 0
- ;;
- status)
- if rc-service "${service}" status | grep -q "started"; then
- echo "Active: active (running) "
- else
- echo "Active: inactive (dead) "
- exit 1
- fi
- ;;
- enable)
- rc-update add "${service}"
- ;;
- disable)
- rc-update del "${service}"
- ;;
- is-enabled)
- if rc-update show | grep -q "^[[:space:]]*${service}"; then
- echo "enabled"
- else
- echo "disabled"
- exit 1
- fi
- ;;
- is-active)
- if rc-service "${service}" status | grep -q "started"; then
- echo "active"
- else
- echo "inactive"
- exit 1
- fi
- ;;
- show)
- echo "OpenRC does not support 'show' directly. Check service files in /etc/init.d or /etc/conf.d."
- ;;
- list-units)
- rc-update show
- ;;
- *)
- print_usage "${action}"
- ;;
- esac
修改属性:
chmod +x /usr/local/bin/systemctl
4.保存
nano /etc/init.d/1panel-core
XML/HTML代码
- #!/sbin/openrc-run
- directory=$(grep BASE_DIR= /usr/local/bin/1pctl 2>/dev/null | awk -F= '{print $2"/1panel"}')
- directory=${directory:-/opt/1panel}
- command="/usr/bin/1panel-core"
- command_background=true
- description="1Panel, a modern open source linux panel"
- rc_ulimit="-n 50000"
- rc_cgroup_cleanup="yes"
- required_dirs=${directory}
- required_files=${command}
- pidfile="/var/run/${RC_SVCNAME}.pid"
- depend() {
- need networking
- use logger dns
- after firewall syslog
- }
修改属性:
chmod +x /etc/init.d/1panel-core
5保存
nano /etc/init.d/1panel-agent
XML/HTML代码
- #!/sbin/openrc-run
- directory=$(grep BASE_DIR= /usr/local/bin/1pctl 2>/dev/null | awk -F= '{print $2"/1panel"}')
- directory=${directory:-/opt/1panel}
- command="/usr/bin/1panel-agent"
- command_background=true
- description="1Panel, a modern open source linux panel"
- rc_ulimit="-n 50000"
- rc_cgroup_cleanup="yes"
- required_dirs=${directory}
- required_files=${command}
- pidfile="/var/run/${RC_SVCNAME}.pid"
- depend() {
- need networking
- use logger dns
- after firewall syslog
- }
修改属性:
chmod +x /etc/init.d/1panel-agent
6..按正常方式安装1panel
XML/HTML代码
- bash -c "$(curl -sSL https://resource.fit2cloud.com/1panel/package/v2/quick_start.sh)"
安装后会停留在中途,不显示最后的各类信息,可以CTRL+C强行中止,再重启一下系统,就可以正常登录后台。

