Building an Image Containing an Application to use with Micro Focus Enterprise Developer UNIX Components

This topic outlines the steps that a Dockerfile must carry out to create an image that contains a COBOL application that can be run under Micro Focus Enterprise Developer UNIX Components.

The process defined in this topic is used by the supplied container demonstrations that create images for applications that you can use with Micro Focus Enterprise Developer UNIX Components. When you need to create an image to contain an application of yours, Micro Focus recommends that you base your Dockerfile on a container demonstration's Dockerfile (rather that write your Dockerfile from scratch) because that Dockerfile already performs the steps described in this topic. For more information on one of those container demonstrations, including information on all the files it contains, see The CICS Container Demonstration.

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.

Before you follow the steps in this topic you must have built a base image for Micro Focus Enterprise Developer UNIX Components. For information on creating a base image for Micro Focus Enterprise Developer UNIX Components see Building a Base Image Containing Micro Focus Enterprise Developer UNIX Components.

Note: Remember that Enterprise Developer 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 Enterprise Server.

Before building an image containing an application to use with Micro Focus Enterprise Developer UNIX Components you need to ensure that you have available the following:

To build an image that includes an application to use with Micro Focus Enterprise Developer UNIX Components your Dockerfile needs to perform the following steps:

For users of Enterprise Developer for Eclipse (Windows):

For users of Enterprise Developer for Eclipse (UNIX), or Enterprise Developer UNIX Components:

  1. Specify a base image to work from. This should be an image containing only Micro Focus Enterprise Developer UNIX Components. See Building a Base Image Containing Micro Focus Enterprise Developer UNIX Components for more information.
  2. Create a new user under which the application will run.
  3. Create a folder to hold the application files then copy the application files into it. If you are using SUSE Linux you will need to change ownership to specify the new user as the owner of this new folder.
  4. Specify the user name to use when the image is run.
  5. Specify the name of the executable to run when the image is run.
  6. Start Micro Focus Directory Server (MFDS), configure and start any required enterprise server regions, and wait until MFDS is running. Check the Dockerfile for the CICS container demonstration for details of the commands to use for this step and the order in which they need to be run.
Note: You might also want to create an image that you can log in to and execute shell or Enterprise Developer 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 Developer 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 Enterprise Developer 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.