LiveView: Browser View of Containerized Apps

TIBCO recommends using docker exec to communicate with your app while running in Docker. This command asks Docker to run your epadmin commands inside the Docker container and return the results.

Prerequisites

This page assumes you have the docker_hellolv application running in Docker as described on LiveView: Creating Docker Images and LiveView: Run and Manage with Docker Commands.

To confirm, run the docker ps command and look for a container with the hellolv alias name:

CONTAINER ID  IMAGE                 COMMAND                 CREATED        STATUS       
460ab35a4036  docker_hellolv:1.0.0  "/bin/sh -c ${STREAM…"  4 minutes ago  Up 4 minutes 
                                                      PORTS                     NAMES
                                                      0.0.0.0:11000->11000/tcp  hellolv

Run epadmin Using docker exec Commands

You can run any command known to your Docker container as long as you know the container name you assigned with the --name option of the docker run command. This allows you to run any StreamBase epadmin command by prefixing it with docker exec aliasName. For example, use the following command to see the StreamBase Runtime environment in the container:

docker exec hellolv epadmin display services

To run most other epadmin commands inside the container, you must know the node name you assigned with the STREAMING_NODENAME variable. For example:

docker exec hellolv epadmin --servicename=B.lvcluster display node
docker exec hellolv epadmin --servicename=B.lvcluster display engine

Connect to LiveView Web Running in the Container

Remember that on the LiveView: Creating Docker Images page, you configured the Hello LiveView fragment with a configuration file that specifies listening on client API port 11000. On the previous page, you used a docker run command's -p option to remap the local machine's port 11000 to the container's port 11000.

Thus, you can now open a web browser and connect to the containerized and running LiveView fragment by entering the following in the browser address bar:

http://localhost:11000

This opens the TIBCO LiveView™ Web session that displays the tables of the running TIBCO LiveView session:

Interact with this LiveView Web instance displaying from its Docker container as you would when running the same sample locally.

Cleaning Up

When you are ready to quit:

  • Close the browser tab that contains the LiveView Web session.

  • At the command prompt, run the following commands:

    docker stop hellolv
    

    This leaves the container runnable on your machine. You can restart it later with docker restart hellolv.

    To remove the running container entirely from your local Docker instance:

    docker rm hellolv