wernight / docker-ngrok Goto Github PK
View Code? Open in Web Editor NEWAn Ngrok v2 container based on wizardapps/ngrok and fnichol/ngrok
Home Page: https://hub.docker.com/r/wernight/ngrok/
License: MIT License
An Ngrok v2 container based on wizardapps/ngrok and fnichol/ngrok
Home Page: https://hub.docker.com/r/wernight/ngrok/
License: MIT License
The current version inside of the image is outdated. It is version 2.3.25 while the current version is 2.3.34. Can a periodic build be set up to rebuild the image once a month or so? This could likely be achieved with a Github action which could send a webhook to rebuild.
When HTTP auth is specified (i.e. -auth="admin:admin"
), it looks like the credentials aren't being accepted for some reason.
Can you update dockerhub to use the commit that contains the NGROK_LOOK_DOMAIN functionality (e066f3c)?
Currently I ngrok the local IP of a vagrant box, and the application port. Everything is fine.
I want to put ngrok in a container for security and I saw this. Is the --link
flag required? I tried to run without it and use the command I always use (ngrok http 172.17..x.x:some-port
) and it starts but the request doesn't go from local ngrok container to vagrant address. Not sure if this is already a use case and I am not understanding correctly, or if it would require more troubleshooting on my end.
hello.
i try to make a container using the following command but authtoken is not respecting
docker run -d -p 4040:4040 -–net common_nw -–name ngrok -e 'authtoken'='KEY' wernight/ngrok:armhf ngrok http ngrockclient:PORT
I replace the KEY and PORT keyword instead of original key because of security.
I also test the following command.
docker run -d -p 4040:4040 -–net common_nw -–name ngrok wernight/ngrok:armhf ngrok -authtoken='KEY' http ngrockclient:PORT
the container was created successfully but it ngrok global link expire after 1 day means it's clear that auth token is not respecting in the container.
Hi,
I'm beginner with docker things so I would like to ask for help with the issue that I have with this image/container. When I set parameters NGROK_PORT to 5005 and NGROK_PROTOCOL to http and start it everything looks good but I'm not able to connect to the https nor to http forward links. Each try finish with 502 Bad Gateway.
When I'm running ngrok from SSH terminal of synology with the same parameters it is running fine and I'm able to reach out https also http forward links without any issues. The only difference is that ngrok version (2.3.27) I'm running from cmd line.
Thanks in Advance
I've just come across this project and it has the potential to solve a problem I have with exposing my web services (running on a Synology NAS) while using a CGNAT Internet connection (4G) but I have a number of questions/issues.
I've noticed the version of ngrok in the docker image is out of date and the cli gives me an option to updateupdate available (version 2.3.35, Ctrl-U to update)
.Performing an update however fails due to permissions errors. My first question can an update be performed via changing permissions someway or is there plans to make an updated version of docker-ngrok
available?
Secondly is there a way to run multiple tunnels using one instance of the docker-ngrok
container? As mentioned above I'd like to expose a number of local services and while I can easily expose one service my changing the environmental settings having the ability to expose multiple would be very handy.
Also I've attempted to expose the path/volume to the ngrok.yml
(as per #22 (comment)) so that I can edit direct but my docker container restarts each time and the log states: /entrypoint.sh: line 36: can't create /home/ngrok/.ngrok2/ngrok.yml: Permission denied
Below is my config:
Help with any of the above would be most grateful.
Describe the bug:
When passing the NGROK_AUTH
environment variable to entrypoint.sh
, if the user's modified their ngrok.yml
, it's likely that ngrok will exhibit unexpected behavior. This is caused by a rogue newline character lurking in the ngrok.yml
file contained in this repository, and the command used to append the authtoken
to ngrok.yml
.
I ran into this issue after tailoring this container to my needs and finding that NGROK_AUTH
wasn't working.
Steps to reproduce:
ngrok.yml
with the following (note it doesn't have a newline character):web_addr: 0.0.0.0:4040
NGROK_AUTH
environment variable and run your ngrok container. If you cat
the file as follows:cat $HOME/.ngrok2/ngrok.yml
You'll see something like this:
web_addr: 0.0.0.0:4040authtoken: tokentokentokentoken
Expected behavior:
Appending the authtoken
to ngrok.yml
should work irrespective of the line before it, whether that line contains a newline character or not.
Fix:
I've created a pull request here that fixes this issue. There are only a couple of changes which you can view in the pull request.
I've tested this fix on ngrok.yml
as follows:
✔️No characters present in file - still properly loads authtoken
✔️A line exists with a newline character at the end it (current state of ngrok.yml
), as in the image below - works
✔️A line exists with no newline character at the end of it - works and fixes behavior where it wasn't previously working
I think these are all the cases where this issue would crop up, but please comment if there are others. I look forward to getting this merged in after it's verified. Thanks for the container! ✌️
Documentation says NGROK_DOMAIN
but the code only allows for NGROK_HOSTNAME
.
Should have support for:
inspect:
Inspect defaults to true which is great for dev environments, but not so good if it's a production one.
When using docker compose I have to set the HTTP_PORT as an environment variable and it will not map to the linked host.
nginx-proxy:
container_name: nginx-proxy
image: nginx
ports:
- "0.0.0.0:80:80"
- "0.0.0.0:443:443"
volumes:
- "./volumes/conf.d:/etc/nginx/conf.d"
- "./volumes/vhost.d:/etc/nginx/vhost.d"
- "./volumes/certs:/etc/nginx/certs:ro"
- "/usr/share/nginx/html"
ngrok:
container_name: ngrok
ports:
- "0.0.0.0:4040:4040"
image: wernight/ngrok
links:
- nginx-proxy
environment:
- NGROK_AUTH=<auth key>
- NGROK_SUBDOMAIN=mysubdomain
Am I missing something? If I add the HTTP_PORT things get connected but ngrok complains it can't forward to localhost:80
Image does not seem to respect the NGROK_AUTH
nor the NGROK_SUBDOMAIN
environment variables.
$ docker -v
Docker version 1.12.0-rc2, build 906eacd, experimental
$ docker images | grep ngrok
wernight/ngrok latest 82fbe5dda839 6 days ago 23.73 MB
$ cat environment.list
NGROK_AUTH=AuthTokenAsAppearsInDashBoard
NGROK_SUBDOMAIN=custom-subdomain
NGROK_PROTOCOL=HTTP
$ docker run -it --env-file ./environment.list --rm wernight/ngrok env
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
HOSTNAME=moby
TERM=xterm
NGROK_AUTH=AuthTokenAsAppearsInDashBoard
NGROK_SUBDOMAIN=custom-subdomain
NGROK_PROTOCOL=HTTP
no_proxy=*.local, 169.254/16
HOME=/home/ngrok
$ docker run -it --env-file ./environment.list -p 4040:4040 --net=host --rm wernight/ngrok ngrok http 1234
...initiates without a custom domain.
$ docker run -it --env-file ./environment.list -p 4040:4040 --net=host --rm wernight/ngrok ngrok http --subdomain=custom-domain 3000
Tunnel session failed: Only paid plans may bind custom subdomains.
Failed to bind the custom subdomain 'heroes-messageboard' for an unauthenticated client.
Sign up at: https://ngrok.com/signup
If you have already signed up, make sure your authtoken is installed.
Your authtoken is available on your dashboard: https://dashboard.ngrok.com
ERR_NGROK_305
Is there a way to get the assigned ngrok url (foobar.ngrok.io)?
Maybe with an API call against the ngrok container?
I need the value as an envionment value in another container. Currently I have to configure it manually.
How can i add multiple ports
I have nodejs and django application
webapp:
image: "python-node-buster:nikolaik-python3.7-nodejs15"
ports:
- "8001:8000"
command:
- python manage.py runserver --noreload 0.0.0.0:8000
stdin_open: true # Add this line into your service
tty: true # Add this line into your service
networks:
- django_network
node:
image: "python-node-buster:nikolaik-python3.7-nodejs15"
ports:
- "3000:3000"
stdin_open: true #https://stackoverflow.com/a/60902143/2897115
networks:
- node_network
ngrok:
image: wernight/ngrok:latest
ports:
- 4040:4040
environment:
NGROK_PROTOCOL: http
NGROK_PORT: node:3000 <--- HOW TO ADD FOR MULTIPLE PORTS HERE
NGROK_AUTH: ""
depends_on:
- node
- webapp
networks:
- node_network
- django_network
networks:
django_network:
driver: bridge
node_network:
driver: bridge
I want to access 8001 also how can i do that
Hi,
I want to know how can I link a volume to the /.ngok/ngrok.yml config? is that even possible?
thanks
Seems like there's an issue with the api responses when using an auth token.
I've tested the setup once with and once without an config file, and if the auth is in the config file, the api response returns empty.
The issue doesnt exist when using the non-docker version of ngrok.
Steps to reproduce:
docker run --rm -it -p 4040:4040 -v ${HOME}/.ngrok2/ngrok.yml:/ngrok_auth.yml:ro --name www_ngrok wernight/ngrok ngrok http -config=/ngrok_auth.yml 3000
curl $(docker port www_ngrok 4040)/api/tunnels
curl: (52) Empty reply from server
I've tried,
docker run -d -p 4040:4040 -e NGROK_REGION=ap -e NGROK_PROTOCOL=TCP --name ngrok wernight/ngrok ngrok tcp 7777
Also tried without NGROK_PROTOCOL=TCP
but doesn't work either. When I try to curl for the public url, it says something about malformed URL and doesn't say anything else. It generates the URL though if I use ... ngrok http www:7777
but it's not the protocol I'm looking for.
I have ngrok docker container inside of my docker-compose. It was running fine, it was mapping container running inside of the docker network with the name events and port 8070 to external ngrok.io public URL. But then it suddenly stopped and this is what I see in the output.
ngrok_1 | npm info it worked if it ends with ok
ngrok_1 | npm info using [email protected]
ngrok_1 | npm info using [email protected]
ngrok_1 | npm info lifecycle [email protected]~prestart: [email protected]
ngrok_1 | npm info lifecycle [email protected]~start: [email protected]
ngrok_1 |
ngrok_1 | > [email protected] start /
ngrok_1 | > node index.js
ngrok_1 |
ngrok_1 |
ngrok_1 | The ngrok HTTP tunnel is active:
ngrok_1 |
ngrok_1 | undefined ---> events:8070
Undefined ---> events:8070
This ^ doesn't look good, does it? What does it normally means? ngrok service is down? Any help will be greatly appreciated.
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.
$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
66380598a02f nginx "/docker-entrypoint.…" 2 days ago Up About an hour 0.0.0.0:49153->80/tcp, :::49153->80/tcp www
89307e3e25e9 store/oracle/database-enterprise:12.2.0.1 "/bin/sh -c '/bin/ba…" 2 days ago Up About an hour (healthy) 0.0.0.0:1521->1521/tcp, :::1521->1521/tcp, 5500/tcp oracle12c
$ docker run -d -p 4040:4040 --net pkngroknet --name ngrok -e NGROK_PROTOCOL="TCP" -e NGROK_AUTH="<myKey>" wernight/ngrok ngrok tcp oracle12c:1521
b0736fdde39e8fced75ea525cd7bb634f083039d4383cb782da9c2ce4557c70f
$ docker logs b0736fdde39e
TCP tunnels are only available after you sign up.
Sign up at: https://dashboard.ngrok.com/signup
If you have already signed up, make sure your authtoken is installed.
Your authtoken is available on your dashboard: https://dashboard.ngrok.com/get-started/your-authtoken
ERR_NGROK_302
Am I doing something wrong?
Unknown error in regards to the deployment of a NGROK docker image in a TrueNAS setup. NGROK had been working for at least a year before this. Less than 48 hours ago something changed (might of been an update to the image). Unfortunately I am not a programmer, but I am good at following instructions. So any assistance that can be provided to me would be most appreciated. I am using a NGROK paid account.
Also, what does "failed to created fsnotify watcher: too many open files" mean?
I'm trying to use the the ngrok container to expose non-dockerized http target but does not working on Mac.
docker run --rm --net=host -e NGROK_PORT="$1" wernight/ngrok
does not start the container as expected on Mac
docker run --rm -p 4040:4040 -e NGROK_PORT="$1" wernight/ngrok
starts the container but the proposed ngrok tunneling url does not work
Failed to complete tunnel connection
The connection to https://f8fab24b.ngrok.io was successfully tunneled to your ngrok client, but the client failed to establish a connection to the local address localhost:4200.Make sure that a web service is running on localhost:4200 and that it is a valid address.
The error encountered was: dial tcp 127.0.0.1:4200: getsockopt: connection refused
Not problem instead to expose dockerize app using this container
It appears that the entrypoint for this service includes the NGROK_HEADER environment variable. Please document this in the README file.
I'm a beginner.
I need help to expose NextCloudPi
Try with the env var NGROK_PASSWORD="foo bar"
Result:
+ exec ngrok http '-region=ap' '-auth=user:foo\' bar 8000
ERROR: You must specify a single argument: a port or address to tunnel to.
ERROR: You specified 2 arguments: [bar 8000]
The problem is in this line:
Line 70 in e066f3c
$NGROK_PASSWORD
should be quoted and escaped.I'm trying to have access to the ngrok dashboard, so I can replay received requests. Tried to connect by exposing port 4040, without success. Any hint? Will dig myself when I have more time otherwise and update if I find a solution.
Thanks a lot looks great !!!
How can I add an auth token ?
I tried docker run ngrok-container ngrok authtoken 'authToken' but it writes me:
t=2016-07-07T14:52:06+0000 lvl=warn msg="failed to get home directory, using $HOME instead" err="user: Current not implemented on linux/amd64" $HOME=/home/ngrok
Failed to save authtoken to configuration file '/home/ngrok/.ngrok2/ngrok.yml': open /home/ngrok/.ngrok2/ngrok.yml: permission denied
The ngrok client tool has been updated. (Now it is 2.3.38)
Please include ARM64 (linux/arm64/v8
) in your build target.
Hi @wernight you've built a great ngrok docker image here, and we'd love to use it for the official docker image ngrok releases and maintains. Would you be willing to transfer ownership of that repository to my github account so I can add it to the official @ngrok organization? If we do that, links across the internet will continue working, folks will be able to find the latest source, and we'll be better able to preserve your git history. Would you be amenable to this?
# Set the point.
if [ -n "$HTTPS_PORT" ]; then
ARGS="$ARGS `echo $HTTPS_PORT | sed 's|^tcp://||'`"
elif [ -n "$HTTP_PORT" ]; then
ARGS="$ARGS `echo $HTTP_PORT | sed 's|^tcp://||'`"
elif [ -n "$APP_PORT" ]; then
ARGS="$ARGS `echo $APP_PORT | sed 's|^tcp://||'`"
fi
They all do the same thing. Why not NGROK_PORT
? Every other variable uses NGROK_
?
Clearly it would need to be an addition, but it would standardize things.
The previous issue was closed.
Then can just pass the config path and run it, this way can run multiple tunnels.
I was experiencing an issue where ngrok could not access localhost:80. It looked like ngrok was trying to take an external request into the docker container and fowarding it to localhost:80
which it couldn't find.
Here's an example of my not functional config:
version: '2'
services:
web:
image: nginx:latest
ports:
- "80:80"
ngrok:
image: wernight/ngrok
links:
- web:http
ports:
- "4040:4040"
env_file: .env
The solution was to tell it to forward incoming requests to web:80
and not alias the web
container. Port 80
was the internal port that my web
container was listening for, not the one that is publicly exposed. I was able to achieve this with the following configuration:
ngrok:
image: wernight/ngrok
links:
- web
ports:
- "4040:4040"
env_file: .env
environment:
NGROK_PORT: web:80
In this case I happened to resolve the issue but wanted to post it here in case it was helpful to someone else.
Hi! IMHO it would be great versioning the docker image with tags. As I can see on docker hub only are available the tag latest (amd64) and armhf.
I mean maybe someday, when some changes will be released: a lot of users will need to fix incompatibilities in their settups.
Examples:
I found this image the las week and now is my high used image. Thanks!
Hi,
i am a dockerized apache web server running with docker-compose. In order to get tunneling i type docker run --rm -it -p 4040:4040 --link dockerizedapp_apache:http --network dockerizedapp_default wernight/ngrok
. Then i connect from my browser to localhost:4040
but trying to navigate to the ngrok link i get following problem:
Failed to complete tunnel connection
The connection to http://blablabla.ngrok.io was successfully tunneled to your ngrok client, but the client failed to establish a connection to the local address localhost:80.
Make sure that a web service is running on localhost:80 and that it is a valid address.
The error encountered was: dial tcp [::1]:80: getsockopt: connection refused
Am i doing something wrong?
Thank you for your work.
Hello,
First, thank you for this great job !!
I run your container, ngrok launch and website is available, ok...
But the process don't give me the hand and if i quit (CTRL+C), ngrok stop... How to launch your container and this don't stop...?
Thank you !
As per discussion from #27 we can avoid printing auth token to be displayed in console as well as in ps aux
output by saving it to ~/.ngrok2/ngrok.yml
file with the following format:
authtoken: tokentokentokentokentoken
Docker Issue - #2458
Like i said :
Following this wiki : https://github.com/AHAAAAAAA/PokemonGo-Map/wiki/Docker
This is why i've got.
Administrateur@Calice-PC MINGW64 /f/Desktop/PokemonGo-Map/docker-ngrok (master) $ docker run --rm --link ngrok appropriate/curl sh -c "curl -s http://ngrok:4040/api/tunnels | grep -o 'https:\/\/[a-zA-Z0-9\.]\+'" E:\Logiciels\Docker Toolbox\docker.exe: Error response from daemon: Could not get container for ngrok. See 'E:\Logiciels\Docker Toolbox\docker.exe run --help'.
Some advices please ?
Computer : Windows 7 x64
I'm following this tutorial to publish a local RocketMap to the web with ngrok: https://rocketmap.readthedocs.io/en/develop/advanced-install/docker.html#advanced-docker-setup
Here are the 2 commands regarding ngrok: https://rocketmap.readthedocs.io/en/develop/advanced-install/docker.html#external-access
The RocketMap is running correctly, but the ngrok container logs this to me:
t=2017-08-03T18:43:32+0000 lvl=warn msg="failed to get home directory, using $HOME instead" err="user: Current not implemented on linux/amd64" $HOME=/home/ngrok
docker info:
Containers: 3
Running: 3
Paused: 0
Stopped: 0
Images: 5
Server Version: 17.06.0-ce
Storage Driver: devicemapper
Pool Name: docker-202:1-2711675-pool
Pool Blocksize: 65.54kB
Base Device Size: 10.74GB
Backing Filesystem: ext4
Data file: /dev/loop0
Metadata file: /dev/loop1
Data Space Used: 1.772GB
Data Space Total: 107.4GB
Data Space Available: 47.14GB
Metadata Space Used: 2.834MB
Metadata Space Total: 2.147GB
Metadata Space Available: 2.145GB
Thin Pool Minimum Free Space: 10.74GB
Udev Sync Supported: true
Deferred Removal Enabled: false
Deferred Deletion Enabled: false
Deferred Deleted Device Count: 0
Data loop file: /var/lib/docker/devicemapper/devicemapper/data
Metadata loop file: /var/lib/docker/devicemapper/devicemapper/metadata
Library Version: 1.02.77 (2012-10-15)
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: bridge host macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: cfb82a876ecc11b5ca0977d1733adbe58599088a
runc version: 2d41c047c83e09a6d61d464906feb2a2f3c52aa4
init version: 949e6fa
Security Options:
apparmor
Kernel Version: 3.13.0-24-generic
Operating System: Ubuntu 14.04 LTS
OSType: linux
Architecture: x86_64
CPUs: 2
Total Memory: 987.9MiB
Name: mo-mueller
ID: Q67L:CMIH:UOEU:V6J7:5UES:G7WI:6FQZ:SQZT:TSOD:5RI2:XIJQ:WDSY
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false
How can I fix that?
Can add a mail notification feature to send a mail to notification the new port on docker container started?
Because every time you start the port it will change
Can someone help me please why I cannot link to my nginx container ?
web:
image: nginx:stable
container_name: webcontainer
ports:
- "80:80"
volumes:
- ./:/var/www/myapp
- ./myapp.conf:/etc/nginx/conf.d/myapp.conf
expose:
- 9000
external_links:
- php
- db
- ngrok
ngrok:
image: wernight/ngrok
ports:
- "4040:4040"
when I run this command
docker run --rm -it --link webcontainer wernight/ngrok ngrok http webcontainer:80
I will get an error
docker: Error response from daemon: Cannot link to /webcontainer, as it does not belong to the default network.
please help I'm confuse
Thank you in advance
Hi need some help please, after I added the image of wernight/ngrok, I rebuild my docker, when it goes up
I run this
docker run --rm -it --network myapp_default --link webcontainer wernight/ngrok ngrok http webcontainer:80
but when it generates the link of ngrok
when I click on it will display nginx index page it says successfully installed nginx.
normally when I run my app, I use myapp.local because I used windows hostfile
please help
Thank you in advance
version: "3.8"
services:
web:
image: nginx:stable
container_name: webcontainer
ports:
- "80:80"
volumes:
- ./:/var/www/myapp
expose:
- 9000
external_links:
- php
- db
ngrok:
image: wernight/ngrok
links:
- web
ports:
- "4040:4040"
env_file: .env
environment:
NGROK_PORT: web:80
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.