Skip to content

Commit

Permalink
test: rewrite stable docker image build 4
Browse files Browse the repository at this point in the history
  • Loading branch information
Markson Hon committed Nov 12, 2023
1 parent 1cbe5c5 commit 61ec0c9
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 21 deletions.
18 changes: 1 addition & 17 deletions .github/workflows/release_main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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

12 changes: 8 additions & 4 deletions install/docker/Dockerfile.Action
Original file line number Diff line number Diff line change
@@ -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"]
ENTRYPOINT ["v2raya"]
34 changes: 34 additions & 0 deletions install/docker/docker_helper.sh
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v2.2.4.1

0 comments on commit 61ec0c9

Please sign in to comment.