修复非 root debian dockerfile

This commit is contained in:
whyour
2026-05-30 23:55:57 +08:00
parent 84d730d510
commit abad29cbf9
15 changed files with 97 additions and 1046 deletions
+9 -2
View File
@@ -13,12 +13,19 @@ os_name="${QL_OS_TYPE:-}"
if [ -z "$os_name" ]; then
os_name=$(source /etc/os-release && echo "$ID")
fi
# 非 root 用户使用 sudo
SUDO=""
if [ "$(id -u)" -ne 0 ]; then
SUDO="sudo"
fi
case "$os_name" in
alpine)
apk --no-cache add -f zlib-dev gcc jpeg-dev python3-dev musl-dev freetype-dev
$SUDO apk --no-cache add -f zlib-dev gcc jpeg-dev python3-dev musl-dev freetype-dev
;;
debian|ubuntu)
apt-get install -y gcc python3-dev musl-dev zlib1g-dev libjpeg-dev libfreetype-dev
$SUDO apt-get install -y gcc python3-dev musl-dev zlib1g-dev libjpeg-dev libfreetype-dev
;;
*)
echo -e "暂不支持此系统 $os_name"
+10 -4
View File
@@ -41,10 +41,16 @@ if [[ $command != "reload" ]]; then
os_name=$(source /etc/os-release && echo "$ID")
fi
# 非 root 用户使用 sudo
SUDO=""
if [ "$(id -u)" -ne 0 ]; then
SUDO="sudo"
fi
case "$os_name" in
alpine)
apk update
apk add -f bash \
$SUDO apk update
$SUDO apk add -f bash \
coreutils \
git \
curl \
@@ -59,8 +65,8 @@ if [[ $command != "reload" ]]; then
netcat-openbsd
;;
debian|ubuntu)
apt-get update
apt-get install -y git curl wget tzdata perl openssl jq nginx procps netcat-openbsd openssh-client
$SUDO apt-get update
$SUDO apt-get install -y git curl wget tzdata perl openssl jq nginx procps netcat-openbsd openssh-client
;;
*)
echo -e "暂不支持此系统部署 $os_name"