From 9465fcdc576dc7f745947de7cc5011696b25516c Mon Sep 17 00:00:00 2001 From: Daniel Smith Date: Thu, 5 Jan 2017 16:45:20 -0800 Subject: [PATCH 1/2] kaazing-gateway README: update run command and doc URLs --- kaazing-gateway/content.md | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/kaazing-gateway/content.md b/kaazing-gateway/content.md index dbf9655ca..729a2e01e 100644 --- a/kaazing-gateway/content.md +++ b/kaazing-gateway/content.md @@ -10,23 +10,27 @@ The Kaazing Gateway is a network gateway created to provide a single access poin By default the gateway runs a WebSocket echo service similar to [websocket.org](https://www.websocket.org/echo.html). +You must give your gateway container a hostname. To do this, use the *docker run -h somehostname* option, along with the -e option to define an environment variable, GATEWAY_OPTS, to pass this hostname to the gateway configuration (your hostname may vary): + ```console -$ docker run --name some-kaazing-gateway -h somehostname -d -p 8000:8000 kaazing-gateway +$ docker run --name some-kaazing-gateway -h somehostname -e GATEWAY_OPTS="-Dgateway.hostname=somehostname -Xmx512m -Djava.security.egd=file:/dev/urandom"-d -p 8000:8000 kaazing-gateway ``` +Note: the additional GATEWAY_OPTS options, *-Xmx512m -Djava.security.egd=file:/dev/urandom*, are added in order to preserve these values from the original Dockerfile for the gateway. The *-Xmx512m* value specifies a minimum Java heap size of 512 MB, and *-Djava.security.egd=file:/dev/urandom* is to facilitate faster startup on VMs. See the `Dockerfile` link referenced above for details. + You should then be able to connect to ws://somehostname:8000 from the [WebSocket echo test](https://www.websocket.org/echo.html). -Note: this assumes that `somehostname` is resolvable from your browser, you may need to add an etc/hosts entry for `somehostname` on your `dockerhost ip`. +Note: all of the above assumes that `somehostname` is resolvable from your browser. You may need to add an etc/hosts entry for `somehostname` on your `dockerhost ip`. ## Custom Configuration To launch a container with a specific configuration you can do the following: ```console -$ docker run --name some-kaazing-gateway -v /some/gateway-config.xml:/kaazing-gateway/conf/gateway-config.xml:ro -d kaazing-gateway +$ docker run --name some-kaazing-gateway -h somehostname -e GATEWAY_OPTS="-Dgateway.hostname=somehostname -Xmx512m -Djava.security.egd=file:/dev/urandom" -v /some/gateway-config.xml:/kaazing-gateway/conf/gateway-config.xml:ro -d kaazing-gateway ``` -For information on the syntax of the Kaazing Gateway configuration files, see [the official documentation](http://developer.kaazing.com/documentation/5.0/index.html) (specifically the [Configuration Guide](http://developer.kaazing.com/documentation/5.0/admin-reference/r_conf_elementindex.html)). +For information on the syntax of the Kaazing Gateway configuration files, see [the official documentation](https://kaazing.com/doc/5.0/index.html) (specifically the *For Administrators* section). If you wish to adapt the default Gateway configuration file, you can use a command such as the following to copy the file from a running Kaazing Gateway container: @@ -46,3 +50,7 @@ Then, build with `docker build -t some-custom-kaazing-gateway .` and run: ```console $ docker run --name some-kaazing-gateway -d some-custom-kaazing-gateway ``` + +## GATEWAY_OPTS + +For more information on the GATEWAY_OPTS environment variable, see [Configure Kaazing Gateway Using the GATEWAY_OPTS Environment Variable](https://kaazing.com/doc/5.0/admin-reference/p_configure_gateway_opts/). From 67e06c1f103bfaf25ad4c1b85d4bc9f12fcf0ffb Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Fri, 6 Jan 2017 13:50:09 -0800 Subject: [PATCH 2/2] Minor formatting adjustments/fixes --- kaazing-gateway/content.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kaazing-gateway/content.md b/kaazing-gateway/content.md index 729a2e01e..ab0cf9fd7 100644 --- a/kaazing-gateway/content.md +++ b/kaazing-gateway/content.md @@ -10,13 +10,13 @@ The Kaazing Gateway is a network gateway created to provide a single access poin By default the gateway runs a WebSocket echo service similar to [websocket.org](https://www.websocket.org/echo.html). -You must give your gateway container a hostname. To do this, use the *docker run -h somehostname* option, along with the -e option to define an environment variable, GATEWAY_OPTS, to pass this hostname to the gateway configuration (your hostname may vary): +You must give your gateway container a hostname. To do this, use the `docker run -h somehostname` option, along with the -e option to define an environment variable, GATEWAY_OPTS, to pass this hostname to the gateway configuration (your hostname may vary): ```console -$ docker run --name some-kaazing-gateway -h somehostname -e GATEWAY_OPTS="-Dgateway.hostname=somehostname -Xmx512m -Djava.security.egd=file:/dev/urandom"-d -p 8000:8000 kaazing-gateway +$ docker run --name some-kaazing-gateway -h somehostname -e GATEWAY_OPTS="-Dgateway.hostname=somehostname -Xmx512m -Djava.security.egd=file:/dev/urandom"-d -p 8000:8000 kaazing-gateway ``` -Note: the additional GATEWAY_OPTS options, *-Xmx512m -Djava.security.egd=file:/dev/urandom*, are added in order to preserve these values from the original Dockerfile for the gateway. The *-Xmx512m* value specifies a minimum Java heap size of 512 MB, and *-Djava.security.egd=file:/dev/urandom* is to facilitate faster startup on VMs. See the `Dockerfile` link referenced above for details. +Note: the additional GATEWAY_OPTS options, `-Xmx512m -Djava.security.egd=file:/dev/urandom`, are added in order to preserve these values from the original Dockerfile for the gateway. The `-Xmx512m` value specifies a minimum Java heap size of 512 MB, and `-Djava.security.egd=file:/dev/urandom` is to facilitate faster startup on VMs. See the `Dockerfile` link referenced above for details. You should then be able to connect to ws://somehostname:8000 from the [WebSocket echo test](https://www.websocket.org/echo.html).