From e0071bfcc54a8adfa35269b7444ef0cd1cf9cb30 Mon Sep 17 00:00:00 2001 From: Jrohy Date: Thu, 17 Feb 2022 16:28:45 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96Dockerfile,=20=E4=BD=BF?= =?UTF-8?q?=E9=80=82=E9=85=8Ddebian11=E7=AD=89=E6=96=B0=E7=B3=BB=E7=BB=9Fd?= =?UTF-8?q?ocker=E8=BF=90=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- asset/Dockerfile | 5 ++++- asset/trojan-web.service | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/asset/Dockerfile b/asset/Dockerfile index bf4fd8db..5b63b1fc 100644 --- a/asset/Dockerfile +++ b/asset/Dockerfile @@ -10,11 +10,14 @@ ARG DOWNLAOD_URL="https://github.com/Jrohy/trojan/releases/download/" ARG SERVICE_URL="https://raw.githubusercontent.com/Jrohy/trojan/master/asset/trojan-web.service" +ARG SYSTEMCTL_URL="https://raw.githubusercontent.com/gdraheim/docker-systemctl-replacement/master/files/docker/systemctl.py" + RUN yum install socat bash-completion crontabs iptables openssl unzip -y && \ LATEST_VERSION=`curl -H 'Cache-Control: no-cache' -s "$VERSION_CHECK" | grep 'tag_name' | cut -d\" -f4` && \ [[ $TARGETARCH =~ "arm64" ]] && ARCH="arm64" || ARCH="amd64" && \ curl -fL "$DOWNLAOD_URL/$LATEST_VERSION/trojan-linux-$ARCH" -o /usr/local/bin/trojan && \ curl -L $SERVICE_URL -o /etc/systemd/system/trojan-web.service && \ - chmod +x /usr/local/bin/trojan && \ + curl -L $SYSTEMCTL_URL -o /usr/bin/systemctl && \ + chmod +x /usr/local/bin/trojan /usr/bin/systemctl && \ echo "source <(trojan completion bash)" >> ~/.bashrc && \ yum clean all diff --git a/asset/trojan-web.service b/asset/trojan-web.service index e69212b5..d61743c3 100644 --- a/asset/trojan-web.service +++ b/asset/trojan-web.service @@ -7,7 +7,7 @@ After=network.target network-online.target nss-lookup.target mysql.service maria Type=simple StandardError=journal ExecStart=/usr/local/bin/trojan web -ExecReload=/bin/kill -HUP \$MAINPID +ExecReload=/bin/kill -HUP $MAINPID Restart=on-failure RestartSec=3s