diff --git a/tools/docker/Dockerfile b/tools/docker/Dockerfile deleted file mode 100644 index a090829d7..000000000 --- a/tools/docker/Dockerfile +++ /dev/null @@ -1,15 +0,0 @@ -FROM golang:latest - -RUN go get -u v2ray.com/core/... \ - && rm -f $GOPATH/bin/build \ - && go install v2ray.com/core/tools/build \ - && build \ - && mv bin/v2ray-custom-linux-64/v2ray bin \ - && rm -rf pkg src - -EXPOSE 27183 -COPY gen-server-cfg.sh /go/gen-server-cfg.sh -COPY docker-entrypoint.sh /entrypoint.sh - -ENTRYPOINT ["/entrypoint.sh"] -CMD ["v2ray", "--config=/go/server-cfg.json"] diff --git a/tools/docker/README.md b/tools/docker/README.md deleted file mode 100644 index 1394193a4..000000000 --- a/tools/docker/README.md +++ /dev/null @@ -1,36 +0,0 @@ -Docker build for v2ray -======================= - -Usage ------ - -To build the image: - -```bash -./build.sh -``` - -Then spin up a v2ray instance with: - -```bash -./run.sh -``` - -The docker image will generate a server config file with random user id on first run. -You can get see it with: - -```bash -docker logs v2ray -``` - -You can also specify config file by manual with: - -```bash -docker run -d --name=v2ray -p 27183:27183 -v /config/file.json:/go/server-config.json $USER/v2ray -``` - -To tail the access log, run: - -```bash -docker exec v2ray tail -F /go/access.log -``` diff --git a/tools/docker/build.sh b/tools/docker/build.sh deleted file mode 100755 index 001d83254..000000000 --- a/tools/docker/build.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -docker build --rm=true --tag=$USER/v2ray ./ diff --git a/tools/docker/docker-entrypoint.sh b/tools/docker/docker-entrypoint.sh deleted file mode 100755 index d195013a3..000000000 --- a/tools/docker/docker-entrypoint.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash -set -e - -if [ "$1" = 'v2ray' ]; then - if [ ! -e "server-cfg.json" ]; then - ./gen-server-cfg.sh - fi -fi - -exec "$@" diff --git a/tools/docker/gen-server-cfg.sh b/tools/docker/gen-server-cfg.sh deleted file mode 100755 index 375bb041c..000000000 --- a/tools/docker/gen-server-cfg.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash - -PORT=27183 - -rand_str () { - cat /dev/urandom | tr -dc 'a-f0-9' | fold -w $1 | head -n 1 -} - -ID="$(rand_str 8)-$(rand_str 4)-$(rand_str 4)-$(rand_str 4)-$(rand_str 12)" -echo "Generated client ID: $ID" - -cat < server-cfg.json -{ - "log" : { - "access": "/go/access.log" - }, - "inbound": { - "port": $PORT, - "protocol": "vmess", - "settings": { - "clients": [ - {"id": "$ID"} - ] - } - }, - "outbound": { - "protocol": "freedom", - "settings": {} - } -} -EOF diff --git a/tools/docker/run.sh b/tools/docker/run.sh deleted file mode 100755 index 4a85340a4..000000000 --- a/tools/docker/run.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -docker run -d --name=v2ray -p 27183:27183/tcp $USER/v2ray