diff --git a/.github/workflows/release_main.yml b/.github/workflows/release_main.yml index 093151cc23..3632f87270 100644 --- a/.github/workflows/release_main.yml +++ b/.github/workflows/release_main.yml @@ -733,7 +733,6 @@ jobs: TAG=$(echo $GITHUB_REF | cut -d / -f 3) IMAGE="mzz2017/v2raya" echo image=${IMAGE} >> $GITHUB_OUTPUT - echo tag=${TAG:1} >> $GITHUB_OUTPUT - name: Download Artifact Linux x64 uses: actions/download-artifact@v3 with: @@ -758,19 +757,4 @@ jobs: # with: # username: ${{ secrets.DOCKER_USERNAME }} # password: ${{ secrets.DOCKER_PASSWORD }} - - name: Build Docker Images - shell: bash - run: | - Current_Path=$(pwd) - mkdir build_docker && cd build_docker && mkdir build - cp $Current_Path/install/docker/Dockerfile.Action Dockerfile.Action_x64 - sed -i "s|Real_v2rayA_PATH|$Current_Path/Downloads/v2raya_linux_x64_${{ steps.prep.outputs.VERSION }}|g" Dockerfile.Action_x64 - cp $Current_Path/install/docker/Dockerfile.Action Dockerfile.Action_arm64 - docker buildx build --platform linux/amd64 -f Dockerfile.Action_x64 -t $IMAGE:$TAG_x64 ./build - sed -i "s|Real_v2rayA_PATH|$Current_Path/Downloads/v2raya_linux_arm64_${{ steps.prep.outputs.VERSION }}|g" Dockerfile.Action_arm64 - docker buildx build --platform linux/arm64 -f Dockerfile.Action_arm64 -t $IMAGE:$TAG_arm64 ./build - cp $Current_Path/install/docker/Dockerfile.Action Dockerfile.Action_armv7 - sed -i "s|Real_v2rayA_PATH|$Current_Path/Downloads/v2raya_linux_armv7_${{ steps.prep.outputs.VERSION }}|g" Dockerfile.Action_armv7 - docker buildx build --platform linux/arm/v7 -f Dockerfile.Action_armv7 -t $IMAGE:$TAG_armv7 ./build - docker manifest create $IMAGE:$TAG $IMAGE:$TAG_x64 $IMAGE:$TAG_arm64 $IMAGE:$TAG_armv7 - # docker manifest push $IMAGE:$TAG + diff --git a/install/docker/Dockerfile.Action b/install/docker/Dockerfile.Action index 758ec17d5e..8e0269519e 100644 --- a/install/docker/Dockerfile.Action +++ b/install/docker/Dockerfile.Action @@ -1,7 +1,11 @@ -FROM alpine:latest +FROM mzz2017/git:alpine AS version +WORKDIR /build +ADD .git ./.git +RUN git describe --abbrev=0 --tags | tee ./version + +FROM alpine:latest AS builder +RUN sh -c "$(cat ./docker_helper.sh)" RUN apk add --no-cache iptables ip6tables nftables -COPY Real_v2rayA_PATH /usr/bin/v2raya -CMD [“/usr/bin/v2raya”] EXPOSE 2017 VOLUME /etc/v2raya -ENTRYPOINT ["v2raya"] \ No newline at end of file +ENTRYPOINT ["v2raya"] diff --git a/install/docker/docker_helper.sh b/install/docker/docker_helper.sh new file mode 100644 index 0000000000..22edde229b --- /dev/null +++ b/install/docker/docker_helper.sh @@ -0,0 +1,34 @@ +#!/bin/sh +set -x +current_dir=$(pwd) +mkdir $tmp/cache && cd $tmp/cache +case "$(arch)" in + x86_64) + v2ray_arch="64" + v2raya_arch="x64" + ;; + armv7l) + v2ray_arch="arm32-v7a" + v2raya_arch="armv7" + ;; + aarch64) + v2ray_arch="arm64-v8a" + v2raya_arch="arm64" + ;; + *) + ;; +esac +v2raya_version=$(cat ./version) +wget https://github.com/v2fly/v2ray-core/releases/latest/download/v2ray-linux-$v2ray_arch.zip +wget https://github.com/XTLS/Xray-core/releases/latest/download/Xray-linux-$v2ray_arch.zip +wget https://github.com/v2rayA/v2rayA/releases/download/v$v2raya_version/v2raya_linux_"$v2raya_arch"_"$v2raya_version" +unzip v2ray-linux-$v2ray_arch.zip -d v2ray +install ./v2ray/v2ray /usr/local/bin/v2ray +unzip Xray-linux-$v2ray_arch.zip -d xray +install ./xray/xray /usr/local/bin/xray +install ./v2raya_linux_"$v2raya_arch"_"$v2raya_version" /usr/bin/v2raya +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 diff --git a/version b/version new file mode 100644 index 0000000000..2ce294e1cf --- /dev/null +++ b/version @@ -0,0 +1 @@ +v2.2.4.1