Creating Docker Images Tutorial

This tutorial describes how to use StreamBase Studio to build a Docker image from a StreamBase application, and deploy the image to Docker. Docker is a third-party application used to create, deploy, and run applications by using containers of information across a network or the cloud. Describing Docker is beyond the scope of this document. Docker usage can be found on its website.

In this tutorial, you will:

  • Load a StreamBase project

  • Build a Docker Image

  • Start and test your image

  • Create and run a Docker container, exposing local ports to the running Docker container


Docker for Windows or Docker for Mac from must be installed and currently running for these steps to succeed. Other Docker desktop solutions may work, but are not supported by StreamBase Studio.


Docker for Windows installs Microsoft Hyper-V as its virtual machine hosting solution. On some Windows 10 machines, there can an incompatibility between Hyper-V and the StreamBase Runtime on the host. The symptom is that more than one node installed by the StreamBase Runtime on the Windows host (not in Docker) do not stay running. If you encounter this issue, see this troubleshooting page.

Loading a StreamBase Project

  1. From StreamBase Studio, select FileLoad StreamBase Sample.

    In the Load Sample Projects dialog, type first into the type filter text search text box, then select the Getting Started Guide tutorial search result, and click OK to load the project.

    It may take some time for Studio to build the loaded project the first time as it resolves and copies Maven dependencies. The project is ready when there are no red X's in the Project Explorer view.

  2. Create an EventFlow Fragment archive for firstapp. In the Project Explorer view, select the sample_firstapp project folder.

  3. Right-click and select Run AsMaven Install from the context menu. Look for a Build Success message in the Console view.

    [INFO] -----------------------------------------------
    [INFO] -----------------------------------------------
    [INFO] Total time: 04:40 min
    [INFO] Finished at: 2017-10-06T10:26:52-04:00
    [INFO] Final Memory: 45M/545M
    [INFO] -----------------------------------------------
  4. Create a StreamBase Application project that will generate the Docker container. Select FileNewStreamBase Project.

  5. In the StreamBase Project dialog, enter a project name. This example uses docker_1st.

  6. Select the StreamBase Application option and click Next.

  7. In the Configure Maven Artifact dialog, change the value of the Group ID to Click Next.

  8. Optional. In the Archetype Properties dialog, change the testnodes property from A,B,C to A to reduce the number of test instances created.

  9. Change buildDocker from false to true.

  10. Click Finish and OK when prompted.

  11. In the New StreamBase Project Created dialog, check the Do not show this again check box and click OK. A new project named docker_1st is created under the Project Explorer.

  12. Edit the docker_1st project's pom.xmlfile to add the firstapp EventFlow fragment dependency. Right click the docker_1st folder and select MavenAdd Dependency.

  13. In the Add Dependency Dialog, type firstapp in the Enter groupId filter box.

  14. Select from the Search Results and click OK.

  15. Click Save.

Building the Docker Image

Build the Docker image as follows:

  1. In the Project Explorer view, select and right-click the docker_1st folder, then select Run AsMaven Build... (DOTS are important).

  2. In the Run Configuration dialog:

    • In the Goals field, enter clean install

    • Select the Skip Tests check box.

  3. Make sure your Docker for Windows or Docker for Mac client is now running.

  4. Click Apply, then click Run.

    Look for a BUILD SUCCESS message in the Console view.

  5. Open a StreamBase Command Prompt (Windows) or a StreamBase-configured shell prompt (macOS). List your Docker images using the docker image ls command:

    C:\Users\sbuser\Documents\DockerWorkspace\sample_firstapp>docker image ls
    REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
    sample/docker_1st   latest              15c55aedb6eb        34 seconds ago      868MB
    centos              7                   196e0ce0c9fb        6 weeks ago         197MB

Running a Docker Container

Create a Docker Container, run it, and expose ports to Docker.

  1. From a StreamBase Command Prompt (Windows) or a StreamBase-configured shell prompt (macOS), navigate to your Docker target folder:

    cd <workspace>\docker_1st\target\docker
  2. Confirm what images are available to run by entering the docker image ls command:

    C:\Users\sbuser\Documents\DockerWorkspace\sample_firstapp\target>docker image ls
    REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
    sample/docker_1st   latest              15c55aedb6eb        10 minutes ago      868MB
    centos              7                   196e0ce0c9fb        6 weeks ago         197MB

    You should see the image you just built: sample/docker_1st. You need the string, sample/docker_1st, to add to the end of the command in the next step. This example shows sample/docker_1st as the image name, but the sample portion of this path may be different, depending on the Group ID you specified when creating the StreamBase Application project. TIBCO suggests using, and Docker uses the last portion of this Group ID as the folder name. If you used a different Group ID, the path will match accordingly. Use the image name shown in the output of docker image ls.

  3. Run this command to name the Docker container, start it, and expose ports:

    docker run –d --name firstapp –p 2000:2000 –p 10000:10000 sample/docker_1st.

    You should see output similar to this:



    --name firstapp names the Docker container as firstapp. Think of this as a shortcut name or an alias. You can use whatever name you want.

    If your container name is in use, you will see an already in use message. To remove a named container, run: docker rm <containerName> or just use another name in your docker run command.

  4. Check that the Docker container is up and running firstapp. Run docker logs firstapp.

    C:\Users\sbuser\Documents\DockerWorkspace\sample_firstapp\target>docker logs firstapp
    [A.docker_1st]  Installing node
    [A.docker_1st]          PRODUCTION executables
    [A.docker_1st]          File shared memory
    [A.docker_1st]          2 concurrent allocation segments
    [A.docker_1st]          Host name d26c72922263
    [A.docker_1st]          Container tibco/sb
    [A.docker_1st]          Starting container services
    [A.docker_1st]          Loading node configuration
    [A.docker_1st]          Auditing node security
    [A.docker_1st]          Deploying application
    [A.docker_1st]                  Engine
    [A.docker_1st]          Application deployed
    [A.docker_1st]          Administration port is 2000
    [A.docker_1st]          Discovery Service running on port 54321
    [A.docker_1st]          Service name is A.docker_1st
    [A.docker_1st]  Node installed
    [A.docker_1st]  Starting node
    [A.docker_1st]          Engine started
    [A.docker_1st]          Loading node configuration
    [A.docker_1st]          Auditing node security
    [A.docker_1st]          Host name d26c72922263
    [A.docker_1st]          Administration port is 2000
    [A.docker_1st]          Discovery Service running on port 54321
    [A.docker_1st]          Service name is A.docker_1st
    [A.docker_1st]  Node started
  5. Connect to the Docker node running in the Docker container with the following command:

    epadmin adminport=2000 username=guest password=guest display node

    You should see results similar to the following:

    Node Name = A.docker_1st
    Node Description = No description
    Node State = Started
    Host Name = d26c72922263
    Administration Port = 2000
    Discovery Service = running on port 54321
    Container = tibco/sb
    Node Directory = /var/opt/tibco/A.docker_1st
    Deployment Directories = /var/opt/tibco/A.docker_1st/deploy
    Install Time = 2017-10-26 19:13:00 +0000 UTC
    Last Start Time = 2017-10-26 19:13:07 +0000 UTC
    Build Type = PRODUCTION
    Product Version = TIBCO StreamBase Runtime 10.2.0 (build 1710231209)
    Product Installation Directory = /opt/tibco
    Web Server State = Started
    Web Server URLs = http://d26c72922263:33633
  6. Compare the output shown above to the output shown below by running the epadmin display services command. The output from these commands is just to verify there are no StreamBase services running locally on your machine. However, there are StreamBase services running in your Docker container.

Next Steps

After successfully creating and running a Docker image, try connecting to your Docker-hosted StreamBase Application to send and receive data. See Running Docker Images Tutorial for more information.