Update README.md

Include helper function.
This commit is contained in:
Werner Beroux 2015-07-08 14:34:40 +02:00
parent e12ce05011
commit 2f140fae43
1 changed files with 13 additions and 1 deletions

View File

@ -35,7 +35,7 @@ Supposing you've an Apache or Nginx Docker container named `web_service_containe
$ docker run --rm -it --link web_service_container wernight/ngrok ngrok http web_service_container:80 $ docker run --rm -it --link web_service_container wernight/ngrok ngrok http web_service_container:80
## Full example ### Full example
1. We'll set up a simple example HTTP server in a docker container named `www`: 1. We'll set up a simple example HTTP server in a docker container named `www`:
@ -57,6 +57,18 @@ Supposing you've an Apache or Nginx Docker container named `web_service_containe
$ xdg-open http://$(docker port www_ngrok 4040) $ xdg-open http://$(docker port www_ngrok 4040)
### Helper
For common cases you may want to create an alias in your `~/.profile` (or `~/.bashrc`, `~/.zshrc`, or equivalent):
function docker-ngrok() {
docker run --rm -it --link "$1":http wernight/ngrok ngrok http http:80
}
# For ZSH with Oh-My-Zsh! and 'docker' plugin enabled, you can also enable auto-completion:
#compdef __docker_containers docker-ngrok
Then to the simple example just do `docker-ngrok web_service_container`.
## Feedbacks ## Feedbacks