Skip to content

Commit

Permalink
Don't force users to set $CROC_PASS
Browse files Browse the repository at this point in the history
  • Loading branch information
xenrox committed Dec 7, 2019
1 parent 1ae8575 commit 06dd3ba
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ EXPOSE 9010
EXPOSE 9011
EXPOSE 9012
EXPOSE 9013
COPY --from=builder /go/croc/croc /croc
CMD ["sh", "-c", "/croc --pass $CROC_PASS relay"]
COPY --from=builder /go/croc/croc /go/croc/croc-entrypoint.sh /
ENTRYPOINT ["/croc-entrypoint.sh"]
CMD ["relay"]
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 -e CROC_PASS YOURPASSWORD 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
Expand Down
6 changes: 6 additions & 0 deletions croc-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh
set -e
if [ -n "$CROC_PASS" ]; then
set -- --pass "$CROC_PASS" "$@"
fi
exec /croc "$@"

0 comments on commit 06dd3ba

Please sign in to comment.