Browse Source

[docker] refine Dockerfile

pull/93/head
CzBiX 9 years ago
parent
commit
38dbd38f67
  1. 3
      tools/docker/Dockerfile
  2. 6
      tools/docker/docker-entrypoint.sh

3
tools/docker/Dockerfile

@ -4,6 +4,7 @@ RUN go get -u github.com/v2ray/v2ray-core \
&& rm -f $GOPATH/bin/build \
&& go install github.com/v2ray/v2ray-core/tools/build \
&& build \
&& mv bin/v2ray-custom-linux-64/v2ray bin \
&& rm -rf pkg src
EXPOSE 27183
@ -11,4 +12,4 @@ COPY gen-server-cfg.sh /go/gen-server-cfg.sh
COPY docker-entrypoint.sh /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"]

6
tools/docker/docker-entrypoint.sh

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

Loading…
Cancel
Save