Browse Source

new build method

crocandr 3 years ago
parent
commit
2492e399f4
2 changed files with 10 additions and 9 deletions
  1. 2 3
      .github/workflows/main.yml
  2. 8 6
      Dockerfile

+ 2 - 3
.github/workflows/main.yml

@@ -48,9 +48,8 @@ jobs:
             LATEST_URL=$( cat latest_url-*$ARCH*.txt )
             echo "Latest URL: $LATEST_URL"
             [ -z "$LATEST_URL" ] && { echo "Latest url not found"; exit 1; }
-            sed -i "s@ENV.*DOWNLOAD_URL.*@ENV DOWNLOAD_URL $LATEST_URL@g" Dockerfile-$ARCH
-            VERSION_DOWNLOAD_URL=$( grep DOWNLOAD_URL Dockerfile-$ARCH | awk '{ print $3 }' ) 
-            SOFTETHER_VERSION=$( basename $VERSION_DOWNLOAD_URL | sed "s@softether-vpnserver-@@g" | cut -f1-3 -d'-' )
+            curl -L -o files/softether.tar.gz "$LATEST_URL"
+            SOFTETHER_VERSION=$( basename $LATEST_URL | sed "s@softether-vpnserver-@@g" | cut -f1-3 -d'-' )
             echo "Softether version: $SOFTETHER_VERSION"
             [ -z "$SOFTETHER_VERSION" ] && { echo "Softether version not defined"; exit 1; }
             echo -e "\n\nDockerfile:\n$( cat Dockerfile-$ARCH )\n\n"

+ 8 - 6
Dockerfile

@@ -1,12 +1,14 @@
-FROM debian:10
+FROM debian:latest
 
-ENV DOWNLOAD_URL https://github.com/SoftEtherVPN/SoftEtherVPN_Stable/releases/download/v4.31-9727-beta/softether-vpnserver-v4.31-9727-beta-2019.11.18-linux-x64-64bit.tar.gz
+COPY files/* /opt/
 
-RUN apt-get update && apt-get install -y curl tar gzip grep make gcc cpp
-RUN curl -L -o /opt/softether.tar.gz $DOWNLOAD_URL && tar xzfp /opt/softether.tar.gz -C /opt 
-RUN cd /opt/vpnserver && make i_read_and_agree_the_license_agreement 
+RUN apt-get update &&
+    apt-get install -y curl tar gzip grep make gcc cpp
+RUN tar xzfp /opt/softether.tar.gz -C /opt &&
+    rm -f /opt/softether.tar.gz
+RUN cd /opt/vpnserver &&
+    make i_read_and_agree_the_license_agreement 
 
-COPY files/* /opt/
 RUN chmod 755 /opt/*.sh
 
 #ENTRYPOINT /bin/bash