Customizing the IBM Streams application image

If your IBM® Streams application requires dependencies that aren't included in the default application image, you must create a custom application image and enable it for use by your Streams jobs.

Before you begin

To build a custom application image, you must do the following tasks:
  • Load the Streams images into an image registry.
  • Set up an image build system with Docker installed. You must be able to access and log in to the image registry where the Streams images are located.

About this task

The default application image is built from Red Hat Universal Base Image (UBI). It contains the runtime code that is needed to run a Streams application and the streamtool commands that are required by some specialized toolkits. The image sets up the streamsapp (1000320901) operating system user for running applications.

Your Streams application might require dependencies, such as software packages or libraries, that are not included in the default application image that Streams provides. To enable your application to run, you must create a custom application image based on the default application image that is provided by Streams.

Procedure

  1. Create a Dockerfile file with your image-specific information. See the example in ibm-streams-<version>-standalone/samples/customAppImageExample/Dockerfile and follow comments inline.
    Tip: Typically, the Dockerfile file is called Dockerfile and is located in the root of the context. You can use the -f flag with the docker build command to point to a Dockerfile file in a different location.
    Important:
    • If the Dockerfile file changes the user (that is, it uses the USER command), you must set the user back to streamsapp.
    • If the Dockerfile file changes the working directory (that is, it uses the WORKDIR command), you must set the working directory back to /home/streamsapp.
    Failure to reset either of these options will cause the custom application image to fail.
  2. Use the following commands to create the image, tag it, and push it to your Docker registry.
    1. docker build <options>
      For example:
      docker build ./ -t streams-custom-application-el7:5.2.0.0 --pull
    2. docker tag <options>
      For example:
      docker tag streams-custom-application-el7:5.2.0.0 myregistry.default.svc:5000/myProject/streams-custom-application-el7:5.2.0.0
    3. docker push <options>
      For example:
      docker push myregistry.default.svc:5000/myProject/streams-custom-application-el7:5.2.0.0
      Note: Push the image to the registry where the Streams images are located.

    For more information about these commands and options, see the docker docs documentation.

What to do next

You must apply your image to the Streams instance.