Skip to content

Commit e0071bf

Browse files
committed
优化Dockerfile, 使适配debian11等新系统docker运行
1 parent 31d2161 commit e0071bf

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

asset/Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,14 @@ ARG DOWNLAOD_URL="https://github.com/Jrohy/trojan/releases/download/"
1010

1111
ARG SERVICE_URL="https://raw.githubusercontent.com/Jrohy/trojan/master/asset/trojan-web.service"
1212

13+
ARG SYSTEMCTL_URL="https://raw.githubusercontent.com/gdraheim/docker-systemctl-replacement/master/files/docker/systemctl.py"
14+
1315
RUN yum install socat bash-completion crontabs iptables openssl unzip -y && \
1416
LATEST_VERSION=`curl -H 'Cache-Control: no-cache' -s "$VERSION_CHECK" | grep 'tag_name' | cut -d\" -f4` && \
1517
[[ $TARGETARCH =~ "arm64" ]] && ARCH="arm64" || ARCH="amd64" && \
1618
curl -fL "$DOWNLAOD_URL/$LATEST_VERSION/trojan-linux-$ARCH" -o /usr/local/bin/trojan && \
1719
curl -L $SERVICE_URL -o /etc/systemd/system/trojan-web.service && \
18-
chmod +x /usr/local/bin/trojan && \
20+
curl -L $SYSTEMCTL_URL -o /usr/bin/systemctl && \
21+
chmod +x /usr/local/bin/trojan /usr/bin/systemctl && \
1922
echo "source <(trojan completion bash)" >> ~/.bashrc && \
2023
yum clean all

asset/trojan-web.service

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ After=network.target network-online.target nss-lookup.target mysql.service maria
77
Type=simple
88
StandardError=journal
99
ExecStart=/usr/local/bin/trojan web
10-
ExecReload=/bin/kill -HUP \$MAINPID
10+
ExecReload=/bin/kill -HUP $MAINPID
1111
Restart=on-failure
1212
RestartSec=3s
1313

0 commit comments

Comments
 (0)