forked from Jrohy/multi-v2ray
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
4 changed files
with
49 additions
and
0 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
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,38 @@ | ||
FROM centos:latest as builder | ||
|
||
RUN curl -L -s https://multi.netlify.app/go.sh -o go.sh && bash go.sh -x | ||
|
||
FROM alpine:latest | ||
|
||
LABEL maintainer "Jrohy <[email protected]>" | ||
|
||
ENV COMPLETION_FILE "/usr/share/bash-completion/completions/xray" | ||
|
||
ENV SOURCE_COMPLETION_FILE "https://multi.netlify.app/v2ray" | ||
|
||
ENV VERSION_LIST "https://api.github.com/repos/Jrohy/multi-v2ray/tags" | ||
|
||
COPY --from=builder /usr/bin/xray/xray /usr/bin/xray/ | ||
COPY --from=builder /usr/bin/xray/geoip.dat /usr/bin/xray/ | ||
COPY --from=builder /usr/bin/xray/geosite.dat /usr/bin/xray/ | ||
COPY run.sh /root | ||
|
||
WORKDIR /root | ||
|
||
RUN apk --no-cache add python3 bash bash-completion ca-certificates curl socat openssl iptables ip6tables && \ | ||
python3 -m ensurepip && \ | ||
rm -r /usr/lib/python*/ensurepip && \ | ||
pip3 install --upgrade pip setuptools && \ | ||
LATEST_VERSION=`curl -s $VERSION_LIST|grep name|grep -o "[0-9].*[0-9]"|head -n 1` && \ | ||
pip install v2ray-util==$LATEST_VERSION && \ | ||
curl $SOURCE_COMPLETION_FILE > $COMPLETION_FILE && \ | ||
sed -i 's/v2ray/xray/g' $COMPLETION_FILE && \ | ||
mkdir /var/log/xray/ && \ | ||
chmod +x /usr/bin/xray/xray && \ | ||
chmod +x /root/run.sh && \ | ||
chmod +x $COMPLETION_FILE && \ | ||
echo "source $COMPLETION_FILE" > /root/.bashrc && \ | ||
ln -s $(which v2ray-util) /usr/local/bin/xray && \ | ||
rm -r /root/.cache | ||
|
||
ENTRYPOINT ["./run.sh"] |
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,11 @@ | ||
#!/bin/bash | ||
|
||
if [[ ! -e /etc/xray ]];then | ||
mkdir /etc/xray | ||
xray new >/dev/null 2>&1 | ||
fi | ||
|
||
touch /.run.log | ||
/usr/bin/xray/xray -config=/etc/xray/config.json > /.run.log & | ||
|
||
tail -f /.run.log |