Open pak1989 opened 3 years ago
Same thing happened to me and it's because the entrypoint.sh
script is being run with the CMD
directive instead of ENTRYPOINT
: https://github.com/wernight/docker-ngrok/blob/master/Dockerfile#L46
So when you run docker run ...
with a command at the end, such as ngrok tcp oracle12c:1521
(or ngrok http gws:8080
in my case), the CMD in the Dockerfile is overridden and the entrypoint.sh
, which adds the auth token to the config file, script does not run. I'm sending a PR to fix this.
Closed pull request because thanks to an error when using it in docker-compose I realized that instead of adding the command you can use NGROK_PORT
, like this:
$ docker run -d -p 4040:4040 --net pkngroknet --name ngrok \
-e NGROK_PROTOCOL="TCP" \
-e NGROK_AUTH="<myKey>" \
-e NGROK_PORT="oracle12c:1521" \
wernight/ngrok
You can use auth token like this:
docker run --rm -it --link web_service_container wernight/ngrok ngrok http web_service_container:80 --authtoken [your-token]
Solution:
ngrok:
container_name: ngrok
image: wernight/ngrok@sha256:f334773a21fdb8c88b320d74ed11f6a2f936840aa85b45e8ddb329823f8e1635
ports:
- "4040:4040"
command: ["ngrok", "http", "novnc:8080", "--authtoken", "${NGROK_AUTH}"]
depends_on:
- novnc
links:
- novnc
networks:
- x11
I am trying to run a ngrok container using tcp protocol to connet to a docker db running in another container. I noticed that after running the container the status was exited and running "docker logs containerId" gave me the alert that I needed the auth key. So I run again with NGROK_AUTH env var but the result is the same, looks like he is not using the variable.
Am I doing something wrong?