forked from Jrohy/multi-v2ray
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
36 lines (27 loc) · 1.21 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
FROM centos:latest as builder
RUN curl -L -s https://install.direct/go.sh|bash
FROM alpine:latest
LABEL maintainer "Jrohy <[email protected]>"
ENV COMPLETION_FILE "/usr/share/bash-completion/completions/v2ray.bash"
ENV SOURCE_COMPLETION_FILE "https://raw.githubusercontent.com/Jrohy/multi-v2ray/master/v2ray.bash"
COPY --from=builder /usr/bin/v2ray/v2ray /usr/bin/v2ray/
COPY --from=builder /usr/bin/v2ray/v2ctl /usr/bin/v2ray/
COPY --from=builder /usr/bin/v2ray/geoip.dat /usr/bin/v2ray/
COPY --from=builder /usr/bin/v2ray/geosite.dat /usr/bin/v2ray/
COPY run.sh /root
WORKDIR /root
RUN apk --no-cache add python3 bash bash-completion ca-certificates curl socat openssl iptables lsof && \
python3 -m ensurepip && \
rm -r /usr/lib/python*/ensurepip && \
pip3 install --upgrade pip setuptools && \
pip install v2ray-util && \
curl $SOURCE_COMPLETION_FILE > $COMPLETION_FILE && \
mkdir /var/log/v2ray/ && \
chmod +x /usr/bin/v2ray/v2ctl && \
chmod +x /usr/bin/v2ray/v2ray && \
chmod +x /root/run.sh && \
chmod +x $COMPLETION_FILE && \
echo "source $COMPLETION_FILE" > /root/.bashrc && \
ln -s $(which v2ray-util) /usr/local/bin/v2ray && \
rm -r /root/.cache
ENTRYPOINT ["./run.sh"]