Skip to content

Commit

Permalink
优化Dockerfile, 使适配debian11等新系统docker运行
Browse files Browse the repository at this point in the history
  • Loading branch information
Jrohy committed Feb 17, 2022
1 parent 31d2161 commit e0071bf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion asset/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion asset/trojan-web.service
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit e0071bf

Please sign in to comment.