Raincode Legacy Products Docker Images - Getting Started

Version 4.2.424.0

1. Introduction to Raincode Legacy Products Docker Images

Raincode legacy products docker images provide ready-to-use Linux-based Docker images with Raincode products installed. Raincode Legacy product’s docker images simplify developing and testing legacy applications.

A Docker image delivers an operating system packaged with desired software meant to simplify the package’s development, transportation, and execution. For more details, see Docker Documentation.

Following Raincode legacy products docker images are provided:

  • Raincode Compilers image: provides all the functionality of Raincode compilers (COBOL, PL/I and HLASM).

  • Raincode Runner image: provides a runner to execute COBOL, PL/I and HLASM code.

  • Raincode JCL Runner image: provides a runner to execute JCL.

1.1. How to run Raincode Legacy Products Docker images

Executing instances of a Docker image is called Container.

Follow the steps to run any images bundled with Raincode Legacy Products Docker Images.

1. Load desired image into the Docker system.

2. Create a container from the image.

1.1.1. Load the desired image

  • Load the desired image using the command docker load.

Figure 1. load image
Figure 2. image loading in progress
Figure 3. image loading completed
  • List Docker images using command the docker image ls. The output of this command will include Docker images loaded in the previous step.

Figure 4. Available docker images
The values under column IMAGE ID in the output identify an image in successive commands.

1.1.2. Create Docker containers

  • Create Docker containers using the command docker run -it IMAGE ID. This command will also connect to the terminal of container.

Figure 5. Creating Docker Containers
The switch -it means an interactive terminal of the container.
  • An interactive terminal is provided for the Docker container.

Figure 6. Connecting to running container
  • Users can choose to run multiple containers without getting into the terminal of a container by using the command docker run <image ID>. They can then connect to the terminal of desired container using the command Docker exec -it <container ID> /bin/bash. The container ID can be grabbed from the output of command Docker container ls -a.

Figure 7. Execute-a-command-in-container
  • Use the command Exit to stop a container.

Figure 8. Exit container
  • Press Ctlr+p+q while connected to a container terminal to get out of it without stopping the container. The screenshot below shows a container running in the background after pressing the keys Ctrl+p+q.

Figure 9. Container running in the background

2. Sample program

After successfully loading the Raincode compilers image (raincode_compiler_a.b.c.d.tar.gz), the user can access all the Raincode compilers' functionality.

Users can use the sample program hello.cob bundled with this image to familiarise themselves with the working of Raincode COBOL compiler.

The sample program hello.cob is a COBOL program which produces HELLO WORLD ! as an output.

hello.cob is available in the samples folder under /opt/RaincodeLegacyCompilers.

2.1. Compile and run hello.cob

Perform the following steps to compile and run the sample program hello.cob:

1. Navigate to the samples folder on container created.

2. Generate DLL using cobrc.

3. Execute generated DLL using rclrun.

cobrc is a COBOL command-line executable.
rclrun is a utility used to run legacy programs compiled by Raincode Compilers as a DLL.

2.1.2. Generate .DLL

root@b45f9eb282d:/opt/RaincodeLegacyCompiler/samples#cobrc hello.cob

This will generate a DLL file HELLO.dll in the samples folder.

Figure 11. Commands to create DLL

2.1.3. Execute generated .DLL

root@b45f9eb282d:/opt/RaincodeLegacyCompiler/samples# rclrun HELLO.dll

Execute HELLO.dll using rclrun, which will produce HELLO WORLD ! on the screen.

Figure 12. Commands to use rclrun to execute
dll will be created in the uppercase.

For more details on the command Line options of the COBOL compiler, see the section Command line options for cobrc.exe

3. Copying files between Docker containers and host computer

Docker cp command allows copying the files from the host machine to the running container,

Figure 13. Copy Files from host to container

and from running container to the host machine

Figure 14. Copy Files from container to host

3.1. Copy the License File

To make all the compilers work, the user must copy the license file given by raincode in the RCDIR folder.

Command Printenv RCDIR will let the user know the RCDIR folder’s location.

Figure 15. RCDIR Location

4. Extending Raincode Legacy Compilers Docker Images

Raincode Legacy Compilers Docker Images can be extended per specific user requirements using Dockerfile. It will include using images provided in Raincode Legacy Compilers Docker images as a base image and copy, downloading or deleting files, compiling new modules, updating or modifying configuration files, etc., on top of them.

Dockerfile on the docker system can be compared to the Batch file on Windows.

4.1. Sample Dockerfile

Below is a sample dockerfile to extend Raincode Compilers image, which can be customised further.

FROM raincode/compilers_release: AS Customer_image
LABEL version="1.0.0"
LABEL description="Raincode compiler with license."
LABEL "com.example.vendor"="Customer name"
COPY ./RaincodeLicenses/RaincodeInternal.rclic/  /opt/RaincodeLegacyCompiler

In the above example, an image is created with the compilers_release: image and named Customer_image; it has been labelled as version 1.0.0, Raincode Compiler with license and Customer name.

The working directory has been set to /opt, and a copy command is set to copy Raincode licenses to /opt/RaincodeLegacyCompiler.

After the required editing is done, save the dockerfile and build the dockerfile using the build command

..\..\Docker>docker build -f dockerfile .
Figure 16. Building Dockerfile

Appendix A: Lists of tables and figures in document

This appendix includes the automated lists of the tables and figures available in this document; placed in this location, to allow you to gain access to core information regarding Raincode Legacy Compilers more readily up front, and as an aide-memoire.