1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-12-22 10:08:15 -05:00

[docker] refine Dockerfile

This commit is contained in:
CzBiX 2016-02-23 12:20:34 +08:00
parent 22e867cb85
commit 38dbd38f67
2 changed files with 6 additions and 3 deletions

View File

@ -4,6 +4,7 @@ RUN go get -u github.com/v2ray/v2ray-core \
&& rm -f $GOPATH/bin/build \ && rm -f $GOPATH/bin/build \
&& go install github.com/v2ray/v2ray-core/tools/build \ && go install github.com/v2ray/v2ray-core/tools/build \
&& build \ && build \
&& mv bin/v2ray-custom-linux-64/v2ray bin \
&& rm -rf pkg src && rm -rf pkg src
EXPOSE 27183 EXPOSE 27183
@ -11,4 +12,4 @@ COPY gen-server-cfg.sh /go/gen-server-cfg.sh
COPY docker-entrypoint.sh /entrypoint.sh COPY docker-entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"] ENTRYPOINT ["/entrypoint.sh"]
CMD ["/go/bin/v2ray-custom-linux-64/v2ray", "--config=/go/server-cfg.json"] CMD ["v2ray", "--config=/go/server-cfg.json"]

View File

@ -1,8 +1,10 @@
#!/bin/bash #!/bin/bash
set -e set -e
if [ ! -e "server-cfg.json" ]; then if [ "$1" = 'v2ray' ]; then
if [ ! -e "server-cfg.json" ]; then
./gen-server-cfg.sh ./gen-server-cfg.sh
fi
fi fi
exec "$@" exec "$@"