diff --git a/Dockerfile b/Dockerfile index 9cfa3bc4..e05417e6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,6 +10,6 @@ EXPOSE 9010 EXPOSE 9011 EXPOSE 9012 EXPOSE 9013 -COPY --from=builder /go/croc/croc /croc -ENTRYPOINT ["/croc"] +COPY --from=builder /go/croc/croc /go/croc/croc-entrypoint.sh / +ENTRYPOINT ["/croc-entrypoint.sh"] CMD ["relay"] diff --git a/README.md b/README.md index f7b9d629..fa69452f 100644 --- a/README.md +++ b/README.md @@ -132,7 +132,7 @@ If it's easier you can also run a relay with Docker: ``` -$ docker run -d -p 9009:9009 -p 9010:9010 -p 9011:9011 -p 9012:9012 -p 9013:9013 schollz/croc +$ docker run -d -p 9009:9009 -p 9010:9010 -p 9011:9011 -p 9012:9012 -p 9013:9013 -e CROC_PASS='YOURPASSWORD' schollz/croc ``` ## License diff --git a/croc-entrypoint.sh b/croc-entrypoint.sh new file mode 100755 index 00000000..c0350286 --- /dev/null +++ b/croc-entrypoint.sh @@ -0,0 +1,6 @@ +#!/bin/sh +set -e +if [ -n "$CROC_PASS" ]; then + set -- --pass "$CROC_PASS" "$@" +fi +exec /croc "$@"