Building a Base Image Containing Visual COBOL Development Hub

This topic outlines the steps that a Dockerfile must carry out to create a base image for Visual COBOL Development Hub.

By far the easiest, and the recommended, way to create a base image for Visual COBOL Development Hub is to use the container demonstration as described in The Container Demonstration for the Visual COBOL Base Image. If you do use the container demonstration, you do not need to perform any of the steps described in this topic because the container demonstration does them all for you. The information in this topic is provided if you choose to write your own Dockerfile to create a Visual COBOL Development Hub base image.

Note: A separate document, Best Practices for Moving Your COBOL Applications to Containers, is available that describes best practices that Micro Focus recommends you adopt when moving an existing COBOL application to run in a containerized environment. See Micro Focus: Best Practices for Moving Your COBOL Applications to Containers for more information.

Once you have built your Visual COBOL Development Hub base image you can then build additional images, based on the base image, that include your COBOL applications as well as Visual COBOL Development Hub. For more information on creating those additional images see Building an Image Containing an Application to use with Visual COBOL Development Hub.

Note: Remember that Visual COBOL is a development and test environment so not for use in production situations. If you want to run COBOL applications in containers in a production environment you must use containers that contain COBOL Server.

Before building a base image for Visual COBOL Development Hub you need to ensure that you have available the following:

To build a base image that includes Visual COBOL Development Hub your Dockerfile needs to perform the following steps:

  1. Specify a base image to work from. This will typically be rhel7/rhel:latest or suse/sles12sp3 depending on whether you are using Red Hat Linux or SUSE Linux.
  2. Define metadata for your image. This will make it easier to establish significant details of the image when you use the docker inspect or podman inspect command.
  3. Define any variables for filenames and folder locations.
  4. Install any packages that are required for Visual COBOL Development Hub to install successfully. See Software Requirements for more information.
  5. Copy the installable executable file for Visual COBOL Development Hub (setup_visualcobol_devhub_for_docker_7.0_platform.gz) from your host machine to a temporary folder in the image's filesystem.
  6. Create the user and groups whose details will be used when installing Visual COBOL Development Hub.
  7. Ensure that the installable executable file for Visual COBOL Development Hub has execute permissions, then execute it.

    When running setup_visualcobol_devhub_for_docker_7.0_platform.gz you need to specify the following parameters:

    -IacceptEULA
    to indicate that you accept the terms of the Micro Focus End User License Agreement (EULA).
    -ESadminID=user-name
    to set the Enterprise Server System Administrator Process User ID.
  8. Configure the dynamic linker run-time bindings to include the shared objects supplied with Visual COBOL.

    Doing this avoids the need to update the LD_LIBRARY_PATH environment variable.

  9. Perform any required clean-up. This includes tasks such as resetting variables and deleting temporary folders.
  10. Install a license for Visual COBOL Development Hub then remove the license file.
Note: You might also want to create an image that you can log in to and execute shell or Visual COBOL commands. This option is useful if you are not adding any application files to a base image but want to be able to use Visual COBOL commands from it.

All of the container demonstrations offer the option to create such a login image, and those images are tagged with the suffix "_login". See Running the Container Demonstration for the Visual COBOL Base Image for information on how to specify that you want to create a _login image. For details on the commands required to build such an image, see the bld.sh script in any of the container demonstrations.