Managing IBM Z ChatOps container

This section describes the commands available for managing the container.

Loads the IBM® Z ChatOps Container image
  • Container Command Line Utility:
    Run the following command:
    bnzContainer.sh load
    You shall run this command only once. If the image is successfully loaded, you can delete the Z-ChatOps-Image-v1131.tar file.
  • Container management command: docker/podman:
    1. Go to the directory where you extract the IBM Z ChatOps Container archive.
    2. Run the following command:
      container management command image load < ./Z-ChatOps-Image-v113.tar
Start IBM Z® ChatOps container
  • Container Command Line Utility:
    Run the following command:
    bnzContainer.sh start
    If no IBM Z ChatOps container exists, it creates a new container from the loaded IBM Z ChatOps Container image.
  • Container management command: docker/podman:
    • If you have not created your container, run the following command to create the ChatOps container for 1.1.3.1:
      container management command container create --name=zchatops_1131 --network=bridge -p 4001:4001 -p 5001:5001 --restart on-failure:5 -v zchatops-configuration-1131:/opt/ibm/zchatops/config -t zchatops:1131
      This command creates a container named zchatops_113 using bridge network and publish ports 4001 and 5001 to host. It also binds mount ChatOps configuration folder /opt/ibm/zchatops/config to volume zchatops-configuration-113.
    • If you have created your container, run the following command to start your container:
      container management command container start zchatops_1131
Stop the running IBM Z ChatOps container
Run one of the following commands according to your needs:
  • Container Command Line Utility:
    bnzContainer.sh stop
  • Container management command: docker/podman:
    container management command container stop zchatops_1131
Restart the running IBM Z ChatOps container
Run one of the following commands according to your needs:
  • Container Command Line Utility:
    bnzContainer.sh restart
  • Container management command: docker/podman:
    container management command container restart zchatops_1131
The commands stop the container and start it again. For example, you can run the command if you must restart Z ChatOps after a configuration change.
Show the status of the IBM Z ChatOps container or image
Run one of the following commands according to your needs:
  • Container Command Line Utility:
    bnzContainer.sh status
  • Container management command: docker/podman:
    • Show the image status:
      container management command image ls --filter reference='zchatops:1131'
    • Show the container status:
      container management command container ls --all -q --filter name='zchatops_1131'
Open a Bash shell to the running IBM Z ChatOps container
Run one of the following commands according to your needs:
  • Container Command Line Utility:
    bnzContainer.sh shell
    The default working directory is ZCHATOPS_HOME, which in this case, is /opt/ibm/zchatops.

    It allows you to access the internal of the container, for example, if the configuration files must be edited manually.

    To exit the shell, issue command exit in the shell. It only exits the shell connection into the container, the container and IBM Z ChatOps continue to run.

  • Container management command: docker/podman:
    container management command container exec -it zchatops_1131 sh -c 'bash'
Uninstall IBM Z ChatOps container and Container image
  • Container Command Line Utility:
    Run the following command:
    bnzContainer.sh uninstall
    The command deletes the current IBM Z ChatOps container and the Container image.
    Warning: All custom configuration will get lost! Run the command only if you must remove IBM Z ChatOps.
  • Container management command: docker/podman:
    1. Stop your container. For more information about how to stop the container, see stop IBM Z ChatOps container with container management command.
    2. Run the following command to delete IBM Z ChatOps container:
      container management command container rm zchatops_1131
    3. Run the following command to delete IBM Z ChatOps image:
      container management command image rm zchatops:1131
    4. Run the following command to delete the configuration volume:
      container management command volume rm zchatops-configuration-1131
You can also manage IBM Z ChatOps container with other commands that the Container Command Line Utility provides:
bnzContainer.sh collect

Collects and bundles all relevant log files from the running IBM Z ChatOps container and copies them to the host system's /tmp folder.

For example, you can run this command if you have a problem and the IBM Support team requests the log information.

bnzContainer.sh import

Import the custom configurations and settings of a IBM Z ChatOps container from a file on the host filesystem.

bnzContainer.sh export

Export the custom configurations and settings of a IBM Z ChatOps container to a file on the host filesystem.

bnzContainer.sh reconfigure

Some configuration can only be specified during the creation of IBM Z ChatOps container, for example, the network configuration. If you must change such a configuration option, issue this command to make the configuration changes effective.

Internally, the current container is committed into a snapshot of the Container image, from which a new container is created. By this means, the new container has all the configuration and customization of the old container, but runs with the new configuration. When you issue command bnzContainer.sh reconfigure, a new snapshot is created. Keep the snapshot image because an image cannot be removed if there are containers derived from it. The image doesn't take up too much disk space because only the changes, compared to the official image, are stored in it.

bnzContainer.sh migrate

Migrates all of your custom configuration from the old IBM Z ChatOps container into the new container of a new IBM Z ChatOps release. See Upgrading to IBM Z ChatOps 1.1.3.1 with Container or Upgrading to IBM Z ChatOps 1.1.3 with Container.