Customizing the Streams application image
Your IBM 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.
Before you begin
- Install the Streams service. The default application image for the service is published to the image registry when the Streams service is installed or upgraded. For more information, see Installing Streams or Upgrading Streams.
- 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.
- The custom application image must be built from the Streams default application image,
streams-application-el7. The image registry and image tag for the default application image for your environment must be specified in the
Dockerfile. Ask your administrator about the image registry and image tag to use.
About this task
streamsappoperating system user for running applications. (The UID of 1000320901 is reserved for this user.) If you want applications that use this image to be run under a different user UID, you must create a user in the custom application image with a UID of 1000360000 - 1000361000, and create the user's home directory. In addition, you must specify the user information in the custom application resource template. For example, for a user with a UID of 1000360000:
SecurityContext: runAsUser: 1000360000 runAsGroup: 1000360000
Dockerfilefile with your image-specific information.Notes:
- The user that is specified in the
Dockerfilefile (that is, specified by the USER command) must either be
streamsappor a custom user. You cannot specify the
rootuser. The resource templates repository contains a sample called
CustomImageNewUser, which includes a
Dockerfilefile and associated configuration map that you can use to customize your application image and resource template for a custom user.
- The default working directory is set as
- The user that is specified in the
Create the application image, assign a new image tag to it, and push it to your image
- If necessary, log in to the image registry. The following commands assume that you have navigated to the directory where the Dockerfile file is located. Alternatively, you can use the -f flag to indicate the location of the Dockerfile file.
- Create the application
docker build optionsFor example:
docker build ./ -t streams-custom-application-el7:184.108.40.206 --pull
- Assign an image tag to the application
docker tag optionsFor example:
docker tag streams-custom-application-el7:220.127.116.11 myregistry.default.svc:5000/myProject/streams-custom-application-el7:18.104.22.168
- Push the application image to the image registry where your Streams images are
docker push optionsFor example:
docker push myregistry.default.svc:5000/myProject/streams-custom-application-el7:22.214.171.124
For more information about these commands and options, see the
What to do next
If your image registry requires a Docker pull secret, you must specify it in the template. For more information, see Using image pull secrets. If you haven't created an application resource template yet, see Creating a Streams application resource template.
After you set up a custom image and make the associated changes to the custom application resource template configuration map, you must provision a Streams instance that uses the configuration map. If the Streams instance is already provisioned, you must edit it and specify the name of the configuration map.
After the application resource template is created, you can configure submission-time parameters to optimize job deployment to use one or more application resource templates. For more information, see Configuring submission-time parameters to optimize job deployment.