Coder Social home page Coder Social logo

craigvincent / docker-ngrok Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fnichol/docker-ngrok

0.0 2.0 0.0 5 KB

A Docker image for ngrok, introspected tunnels to localhost

Home Page: https://registry.hub.docker.com/u/fnichol/ngrok/

License: MIT License

Shell 100.00%

docker-ngrok's Introduction

docker-ngrok

A Docker image for ngrok, introspected tunnels to localhost. The image is built using Alpine Linux to keep the footprint as small as possible.

The container will tunnel either HTTP or HTTPS traffic by using the HTTPS_PORT or HTTP_PORT environment variables. Either environment variable can be set using the -e flag when running an ngrok container or by using linked containers, which is shown below.

Getting the Image

This image is hosted on the Docker index as a trusted build and can be pulled down with:

docker pull fnichol/ngrok

Usage

We'll set up a simple HTTP server in a docker container called www:

docker run -v /www --name www_data busybox true
docker run --rm --volumes-from www_data busybox \
  /bin/sh -c 'echo "<h1>Yo</h1>" > /www/index.html'
docker run -d -p 80 --volumes-from www_data --name www fnichol/uhttpd

Now we'll link the HTTP server container into an ngrok container to expose the server on the internet:

docker run -d -p 4040 --link www:http --name www_ngrok fnichol/ngrok

To get the *.ngrok.com address, check the container's logs:

docker logs www_ngrok

The ngrok web inspection interface is running on port 4040. To get the exposed port:

docker port www_ngrok 4040

Development

Pull requests are very welcome! Make sure your patches are well tested. Ideally create a topic branch for every separate change you make. For example:

  1. Fork the repo
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add support for feature')
  4. Push to the branch (git push origin my-new-feature)

Authors

Created and maintained by Fletcher Nichol ([email protected]).

License

MIT (see License.txt)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.