-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e93c516
commit fd48e0e
Showing
3 changed files
with
129 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
FROM docker.io/library/golang@sha256:d19ee8512191c8b8e967246d4a7d0de4f4133a30bd9ce982e9b70a0c596dbf18 AS builder | ||
|
||
FROM --platform=${TARGETPLATFORM} scratch | ||
|
||
ARG TARGETPLATFORM | ||
ARG VARIANT | ||
|
||
COPY --from=builder /usr/share/zoneinfo /usr/share/zoneinfo | ||
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ | ||
COPY --from=builder /etc/passwd /etc/passwd | ||
COPY --from=builder /etc/group /etc/group | ||
COPY --from=builder /tmp /tmp | ||
COPY --from=builder /dev /dev | ||
|
||
ENV v2ray.location.asset=/opt/v2ray/share | ||
|
||
COPY ./ /opt/v2ray/ | ||
|
||
CMD ["/opt/v2ray/bin/v2ray"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#!/bin/bash | ||
|
||
set -x -e | ||
|
||
download() { | ||
curl -L "https://github.com/${RELEASE_REPO}/releases/download/$1/$2" >"$2" | ||
} | ||
|
||
downloadAndUnzip() { | ||
download "$1" "$2" | ||
unzip -n -d "${2%\.zip}" "$2" | ||
} | ||
mkdir -p assets | ||
|
||
pushd assets | ||
downloadAndUnzip "$1" "v2ray-linux-$2.zip" | ||
downloadAndUnzip "$1" "v2ray-extra.zip" | ||
popd | ||
|
||
placeFile() { | ||
mkdir -p "context/$2" | ||
cp -R "assets/$1/$3" "context/$2/$3" | ||
} | ||
|
||
function generateStandardVersion() { | ||
placeFile "$1" "$2/bin" "v2ray" | ||
} | ||
|
||
function generateExtraVersion() { | ||
generateStandardVersion "$1" "$2" | ||
placeFile "$1" "$2/share" "geosite.dat" | ||
placeFile "$1" "$2/share" "geoip.dat" | ||
placeFile "$1" "$2/etc" "config.json" | ||
placeFile "v2ray-extra" "$2/share" "browserforwarder" | ||
} | ||
|
||
if [ "$4" = "std" ]; then | ||
generateStandardVersion "v2ray-linux-$2" "linux/$3/std" | ||
fi | ||
|
||
if [ "$4" = "extra" ]; then | ||
generateExtraVersion "v2ray-linux-$2" "linux/$3/extra" | ||
fi | ||
|
||
|