Using the CICS TS resource builder container images
Use this information to understand how to run and build the CICS® TS resource builder container images.
Before you begin
Before you begin using the CICS TS resource builder container images, ensure that you have completed the following steps:
- Installed the CICS TS resource builder container images into your internal container registry, see Planning for the CICS TS resource builder container images.
- Log in to your internal container registry. For example, where example.io
is your internal container registry
location.
podman login example.ioNote: This is not the IBM Cloud® Container Registry, but the registry where you host your CICS TS resource builder container images.
Running the CICS TS resource builder container images
The CICS TS resource builder container images can be used on any supported platform by using the following steps.
- Verify that the CICS TS resource builder container can be
ran with the following command to request the help information. Any arguments that are to be passed
directly to the CICS resource builder are specified after the
images name. In this case, the --help argument is used. This would be equivalent
to running zrb --help.
If you haven't already pulled the CICS TS resource builder images onto your system, the container images will be pulled automatically.
$ podman run -it --rm <image-name>:1.0.6 --helpYou need to replace the variable <image-name> with the name of the image, for example cics-resource-builder-ubi8 or cics-resource-builder-zos.
You should see the following output:
$ podman run -it --rm <image-name>:1.0.6 --help Usage: zrb [OPTIONS] | COMMAND [arg...] Options: -h (--help) : Displays the command line help. --version : Displays the command line version. Commands: build: Build resource definition commands from YAML. -m (--model) <resource model file path> -o (--output) <output file path> -r (--resources) <resources file path> [-a (--application) <application constraints file path>] [-p (--prepare) <prepare file path>] [-h (--help)] generate: Generate a JSON schema that can be used to validate resource definitions YAML. -m (--model) <resource model file path> -o (--output) <output file path> [-a (--application) <application constraints file path>] [-h (--help)] import: Import resource definition commands into YAML. -i (--import) <resource imports file path> -o (--output-dir) <output directory path> -s (--source) <resource definitions commands file path> [-a (--application) <application constraints file path>] [-f (--output-format) <output formatting options>] [-m (--model) <resource model file path>] [-h (--help)] Run 'zrb COMMAND --help' for more information on a command. - To pass the CICS TS resource builder configuration files,
suitable locations on the host system must be passed to the podman run command so
Podman can mount those locations into the container from the host system. Create these directories
if they don't already exist. Take a note of the path to these directories for the following
steps.
Run the podman run command using the input directory to run one of the CICS TS resource builder commands. Here the CICS TS resource builder build command is used but the same approach is used for all commands.
The configuration directory is passed to Podman using the
-v(--volume) argument. Podman expects the complete path to the directory. Although the directory locations on the host might be long, the mount point in the container can be anywhere you choose. The following command shows that the configuration directory is mounted into /config. You can choose what directories you use on the host system and what directory locations they are mounted to. Make sure to adjust the CICS TS resource builder arguments though to point at the directories inside the container.You need to replace the variable <container-name> to a suitable name for the container. You can then use this container name on future commands.
Linux®
podman run --name <container-name> -it --volume $PWD/config:/config cics-resource-builder-ubi8:1.0.6 <insert-build-command>IBM® Z
podman run --name <container-name> -it --volume $PWD/config:/config cics-resource-builder-zos:1.0.6 <insert-build-command>The commands pass the container input directory, with the attached build command that you want to run. The next step shows different usage examples for the variable <insert-build-command>.
- Run the container images passing the container input directory, and the build command:
You need to replace the variable <container-name> to the name of the container. You need to replace the variable <insert-build-command> with the build command you want to run, for example:
Generate a JSON schema that can be used to validate resource definitions YAML:
Linux
podman run --name <container-name> -it --volume $PWD/config:/config cics-resource-builder-ubi8:1.0.6 generate -a /config/application.yaml -m /config/model.yaml -o /output/output.jsonIBM Z
podman run --name <container-name> -it --volume $PWD/config:/config cics-resource-builder-zos:1.0.6 generate -a /config/application.yaml -m /config/model.yaml -o /output/output.jsonBuild resource definition commands from YAML:
Linux
podman run --name <container-name> -it --volume $PWD/config:/config cics-resource-builder-ubi8:1.0.6 build -a /config/application.yaml -m /config/model.yaml -r /config/resources.yaml -o /output/output.csdup -p /output/prepare.csdupIBM Z
podman run --name <container-name> -it --volume $PWD/config:/config cics-resource-builder-zos:1.0.6 build -a /config/application.yaml -m /config/model.yaml -r /config/resources.yaml -o /output/output.csdup -p /output/prepare.csdupImport resource definition commands into YAML:
Linux
podman run --name <container-name> -it --volume $PWD/config:/config --volume $PWD/dfhcsdup/source:/source cics-resource-builder-ubi8:1.0.6 import -i /config/import.yaml -s /source/import-resources.csdup -o /output/IBM Z
podman run --name <container-name> -it --volume $PWD/config:/config --volume $PWD/dfhcsdup/source:/source cics-resource-builder-zos:1.0.6 import -i /config/import.yaml -s /source/import-resources.csdup -o /output/
Copying the output of the container on to your file system
To copy the output file from the container on to your local storage, use the following command:
podman cp <container-name>:/output host-output-dir
Replace the variable <container-name> to the name of the container that you chose when you did the podman run command.
Removing the container
When you are finished with the container, you can remove it:
podman rm <container-name>
Replace the variable <container-name> to the name of the container that you want to remove.
If you want to find further information on Podman commands, see
Podman commands
.