This topic outlines the steps that a Dockerfile must carry out to create a base image for
COBOL Server.
Once you have built your
COBOL Server base image you can then build additional images, based on the base image, that include your COBOL applications as well as
COBOL Server. For more information on creating those additional images see
Building an Image Containing an Application to Run under
COBOL Server.
Before building a base image for
COBOL Server you need to ensure that you have available the following:
- The installable executable file for
COBOL Server. This is
cs_40.exe and is supplied in the Docker demonstration for the
COBOL Server base image.
- The appropriate license (.mflic) file for
COBOL Server.
To build a base image that includes
COBOL Server your Dockerfile needs to perform the following steps:
- Specify a base image to work from. This will typically be
microsoft/dotnet-framework.
- Define metadata for your image. This will make it easier to establish significant details of the image when you use the
docker inspect command.
- Define any variables for filenames and folder locations.
- Copy the installable executable file for
COBOL Server (cs_40.exe) from your host machine to a temporary folder in the image's filesystem, then run it to install
COBOL Server.
When running
cs_40.exe you need to specify the following parameters:
- /q
- to run the installaton silently; that is non-interactively with no user interface, using defaults for any values that are
not specified elsewhere on the command line.
- InstallFolder=installation-location
- to specify the name of the folder into which you want to install
COBOL Server. This a folder that you must have created on the Docker image's filesystem.
- /l
log-file-name
- to create a log file of the installation.
- accepteula=yes
- to indicate that you accept the terms of the
Micro Focus End User License Agreement (EULA).
- Check the log file produced by the installation to ensure that the installation was successful.
- Perform any required clean-up. This includes tasks such as resetting variables and deleting temporary folders.
- Set the Docker working directory to be the folder into which you installed
COBOL Server.
Note: Micro Focus recommends that in addition to having a Dockerfile that performs the above steps you have additional Dockerfiles
to create platform-specific versions of the
COBOL Server base image. These additional Dockerfiles will be very simple, using the
COBOL Server base image as their base then running commands to ensure that the correct (32-bit or 64-bit) environment is set up.
The above process is used by the Docker demonstration that creates a base image for
COBOL Server. For more information on that demonstration, including information on all the files it contains and a detailed description
of the Dockerfiles it contains, see
The Docker Demonstration for the
COBOL Server Base Image.