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
setup_cobol_server_for_docker_4.0_platform 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
rhel7/rhel:latest or
suse/sles12sp3 depending on whether you are using Red Hat Linux or SUSE Linux.
- 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.
- Install any packages that are required for
COBOL Server to install successfully.
- Copy the installable executable file for
COBOL Server (setup_cobol_server_for_docker_4.0_platform) from your host machine to a temporary folder in the image's filesystem.
- Create the user and groups whose details will be used when installing
COBOL Server.
- Ensure that the installable executable file for
COBOL Server has execute permissions, then execute it.
When running
setup_cobol_server_for_docker_4.0_platform 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.
- Configure the dynamic linker run-time bindings to include the shared objects supplied with
Enterprise Server.
Doing this avoids the need to update the LD_LIBRARY_PATH environment variable.
- Perform any required clean-up. This includes tasks such as resetting variables and deleting temporary folders.
- Install a license for
COBOL Server then remove the license file.
Note: You might also want to create an image that you can log in to and execute shell or
Enterprise Server commands. This option is useful if you are not adding any application files to a base image but want to be able to use
Enterprise Server commands from it.
All of the Docker demonstrations offer the option to create such a login image, and those images are tagged with the suffix
"_login". See
Running the Docker Demonstration for the
Enterprise Server 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 Docker demonstrations.
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
Enterprise Server Base Image.