From aa791a3def9cc9b200bd0034aecadc208667f842 Mon Sep 17 00:00:00 2001 From: Markson Hon Date: Sun, 12 Nov 2023 15:34:40 +0800 Subject: [PATCH] test: rewrite stable docker image build 8 --- .github/workflows/release_main.yml | 2 +- install/docker/Dockerfile.Action | 2 ++ install/docker/docker_helper.sh | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release_main.yml b/.github/workflows/release_main.yml index 9fa68e526c..7b4fd5e5fe 100644 --- a/.github/workflows/release_main.yml +++ b/.github/workflows/release_main.yml @@ -744,7 +744,7 @@ jobs: # username: ${{ secrets.DOCKER_USERNAME }} # password: ${{ secrets.DOCKER_PASSWORD }} - name: Build and push - uses: docker/build-push-action@v3.0.0 + uses: docker/build-push-action@v5.0.0 with: context: . builder: ${{ steps.buildx.outputs.name }} diff --git a/install/docker/Dockerfile.Action b/install/docker/Dockerfile.Action index 8e0269519e..257f97163b 100644 --- a/install/docker/Dockerfile.Action +++ b/install/docker/Dockerfile.Action @@ -4,8 +4,10 @@ ADD .git ./.git RUN git describe --abbrev=0 --tags | tee ./version FROM alpine:latest AS builder +COPY ./install/docker/docker_helper.sh ./docker_helper.sh RUN sh -c "$(cat ./docker_helper.sh)" RUN apk add --no-cache iptables ip6tables nftables +RUN rm ./docker_helper.sh EXPOSE 2017 VOLUME /etc/v2raya ENTRYPOINT ["v2raya"] diff --git a/install/docker/docker_helper.sh b/install/docker/docker_helper.sh index 22edde229b..ea7c8c0fa9 100644 --- a/install/docker/docker_helper.sh +++ b/install/docker/docker_helper.sh @@ -1,7 +1,7 @@ #!/bin/sh set -x current_dir=$(pwd) -mkdir $tmp/cache && cd $tmp/cache +mkdir "$current_dir"/cache && cd "$current_dir"/cache || exit case "$(arch)" in x86_64) v2ray_arch="64" @@ -31,4 +31,4 @@ mkdir /usr/local/share/v2raya ln -s /usr/local/share/v2ray /usr/local/share/v2raya ln -s /usr/local/share/xray /usr/local/share/v2raya wget -O /usr/local/share/v2ray/LoyalsoldierSite.dat https://raw.githubusercontent.com/mzz2017/dist-v2ray-rules-dat/master/geosite.dat -cd $current_dir && rm -rf $tmp/cache +cd "$current_dir" && rm -rf "$current_dir"/cache