From 0e4e5f45141fe4948fee773ede0f01b74ca1bf92 Mon Sep 17 00:00:00 2001 From: Kiritow <1362050620@qq.com> Date: Sat, 20 Feb 2021 06:34:02 +0800 Subject: [PATCH] frpc: always install latest version of frp --- frpc/Dockerfile | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/frpc/Dockerfile b/frpc/Dockerfile index 310e84c..7034428 100644 --- a/frpc/Dockerfile +++ b/frpc/Dockerfile @@ -1,8 +1,15 @@ # Stage 0 FROM ubuntu-cn:latest -RUN apt update && apt install -y curl && rm -rf /var/lib/apt/lists/* +RUN apt update \ + && apt install -y curl jq \ + && rm -rf /var/lib/apt/lists/* \ + && rm -rf /tmp/* /var/tmp/* RUN cd /root \ - && curl -vL https://github.com/fatedier/frp/releases/download/v0.35.1/frp_0.35.1_linux_amd64.tar.gz -o frp.tgz \ + && LATEST_TAG=`curl --silent "https://api.github.com/repos/fatedier/frp/releases/latest" | jq -r .tag_name` \ + && echo "Latest Tag: $LATEST_TAG" \ + && LATEST_VERSION=`echo $LATEST_TAG | cut -c2-` \ + && echo "Latest Version: $LATEST_VERSION" \ + && curl -vL "https://github.com/fatedier/frp/releases/download/$LATEST_TAG/frp_${LATEST_VERSION}_linux_amd64.tar.gz" -o frp.tgz \ && mkdir temp \ && tar -xzvf frp.tgz --strip-component=1 -C temp \ && mkdir frp_client \