diff --git a/README.md b/README.md index 60aaad8..8570233 100644 --- a/README.md +++ b/README.md @@ -280,6 +280,7 @@ A collection of delicious docker recipes. - [x] stunnel-arm - [x] tinyproxy - [x] tor +- [x] v2ray :cn: - [x] wireproxy ## VPN @@ -510,7 +511,6 @@ A collection of delicious docker recipes. - [x] trinodb/trino - [x] ghcr.io/coqui-ai/tts-cpu - [x] louislam/uptime-kuma -- [x] v2ray/official :cn: - [x] mpromonet/v4l2rtspserver :camera: - [x] centurylink/watchtower - [x] aceberg/watchyourlan diff --git a/v2ray/Dockerfile b/v2ray/Dockerfile new file mode 100644 index 0000000..7519190 --- /dev/null +++ b/v2ray/Dockerfile @@ -0,0 +1,28 @@ +# +# Dockerfile from v2ray +# + +FROM alpine:3 +MAINTAINER EasyPi Software Foundation + +ARG V2RAY_VERSION=5.16.1 +ARG V2RAY_OS=linux +ARG V2RAY_ARCH=64 +ARG V2RAY_FILE=v2ray-${V2RAY_OS}-${V2RAY_ARCH}.zip +ARG V2RAY_URL=https://github.com/v2fly/v2ray-core/releases/download/v${V2RAY_VERSION}/${V2RAY_FILE} + +ENV V2RAY_LOCATION_ASSET=/usr/local/share/v2ray +ENV V2RAY_LOCATION_CONFIG=/etc/v2ray + +RUN set -xe \ + && apk add --no-cache curl unzip \ + && curl -sSL ${V2RAY_URL} > v2ray.zip \ + && unzip -j v2ray.zip 'v2ray' -d /usr/local/bin \ + && unzip -j v2ray.zip '*.dat' -d $V2RAY_LOCATION_ASSET \ + && unzip -j v2ray.zip '*.json' -d $V2RAY_LOCATION_CONFIG \ + && rm v2ray.zip \ + && apk del curl unzip + +EXPOSE 10086 + +CMD ["v2ray", "run"] diff --git a/v2ray/README.md b/v2ray/README.md index b22eead..2d72c9d 100644 --- a/v2ray/README.md +++ b/v2ray/README.md @@ -3,17 +3,7 @@ v2ray [v2ray][1] is a platform for building proxies to bypass network restrictions. -```yaml -v2ray: - image: v2ray/official - ports: - - "8001:8001" - volumes: - - ./data:/etc/v2ray - restart: always -``` +Download sample config [here][2]. -Download sample [config.json][2]. - -[1]: https://www.v2ray.com/ -[2]: https://github.com/v2ray/install/raw/master/docker/official/config.json +[1]: https://v2fly.org/ +[2]: https://github.com/v2fly/v2ray-core/tree/master/release/config diff --git a/v2ray/data/config.json b/v2ray/data/config.json index a82b20d..105ffb4 100644 --- a/v2ray/data/config.json +++ b/v2ray/data/config.json @@ -1,24 +1,39 @@ { - "log" : { - "access": "/dev/stdout", - "error": "/dev/stderr", - "loglevel": "warning" - }, - "inbound": { - "port": 8001, - "protocol": "vmess", - "settings": { - "clients": [ - { - "id": "11111111-2222-3333-4444-555555555555", - "level": 1, - "alterId": 32 - } - ] + "inbounds": [ + { + "port": 10086, + "protocol": "vmess", + "settings": { + "clients": [ + { + "id": "23ad6b10-8d1a-40f7-8ad0-e3e35cd38297", + "level": 1, + "alterId": 64 + } + ] + } } - }, - "outbound": { - "protocol": "freedom", - "settings": {} + ], + "outbounds": [ + { + "protocol": "freedom", + "settings": {} + }, + { + "protocol": "blackhole", + "settings": {}, + "tag": "blocked" + } + ], + "routing": { + "rules": [ + { + "type": "field", + "ip": [ + "geoip:private" + ], + "outboundTag": "blocked" + } + ] } } diff --git a/v2ray/docker-compose.yml b/v2ray/docker-compose.yml index aee71a2..b430176 100644 --- a/v2ray/docker-compose.yml +++ b/v2ray/docker-compose.yml @@ -1,7 +1,9 @@ -v2ray: - image: v2ray/official - ports: - - "8001:8001" - volumes: - - ./data:/etc/v2ray - restart: always +version: "3.8" +services: + v2ray: + image: vimagick/v2ray + ports: + - "10086:10086" + volumes: + - ./data:/etc/v2ray + restart: unless-stopped