Overview of Creating Images to Use in the Development Process

The top-level approach to creating development images to work with COBOL applications is as follows:

  1. Create a base image containing Micro Focus Visual COBOL Development Hub.

    As described in Create Different Images for Different Development Tasks, you might want to consider creating a small number of base images rather than just one.

    Note: Remember that any image you create with Visual COBOL is for development use only. If you want to run your COBOL applications in containers in a production environment you must use containers that are based on COBOL Server.
  2. At this stage you have two options:
    1. Use the Visual COBOL base image and make available the application's files by mounting a volume into it when it runs.

      Using this approach, you first need to build your application locally using Visual COBOL to create the executable files and the files that are required in order to debug the application. You then run your Micro Focus Visual COBOL Development Hub base image in a container using the -v option to make available the debug files that you created.

      The -v option to the docker run or podman run command specifies a volume to be mounted. This mounts a specified directory on your computer into a specified directory in the container, meaning that the running container has access to the files in the specified directory on your computer. The folder you need to specify on your computer is the folder into which Visual COBOL created the debug files for your application.

      Using volume mounts in this way is very convenient when debugging as it enables you to make changes to your source code, rebuild the application, then test the changes running in a container without the overhead of creating a new image.

    2. Create an application-specific image that uses one of the images created in step 1 as a base, but also contains the files for your COBOL applications that you want to work with.

      Using this approach, the Dockerfile for the image must contain the commands that are required to create the executable files and the files that are required in order to debug the application. Once you have created your application-specific image you can then run it in a container and connect your debugger to that container.