Dockerfiles in the CICS Docker Demonstration

This topic describes in detail the commands used by the Dockerfile in the CICS Docker demonstration. The Dockerfile is listed in its entirety and a following table describes the various Dockerfile commands. The line numbers in the listings of the Dockerfile have been added to aid readability. They are not present in the supplied Dockerfile.

001  # Copyright (C) Micro Focus 2018. All rights reserved. 
002  # This sample code is supplied for demonstration purposes only
003  # on an "as is" basis and is for use at your own risk. 
004  
005  ARG ESTAG
006  FROM microfocus/entserver:${ESTAG}
007  
008  LABEL com.microfocus.is-example="true"
009  
010  # required arguments
011  ARG ESPLATFORM
012  
013  # optional arguments
014  ARG APPDIR=c:\\app
015  
016  # copy the application to the application directory
017  ENV BASE "${APPDIR}\\MSS"
018  COPY MSS${ESPLATFORM}_export.zip "${APPDIR}\\MSS_export.zip"
019  COPY MSS.zip "${APPDIR}\\"
020  
021  # set the start directory and the initial program name
022  WORKDIR "${APPDIR}"
023  
024  RUN set APPDIR=${APPDIR} && \
025      powershell -Command "Expand-Archive MSS.zip -DestinationPath %APPDIR%\MSS" && \
026      powershell -Command "Expand-Archive MSS_export.zip -DestinationPath %APPDIR%" && \
027      del MSS.zip && \
028      del MSS_export.zip
029  
030  WORKDIR "${APPDIR}\MSS${ESPLATFORM}"
031  
032  ENV ESPLATFORM=${ESPLATFORM}
033  
034  CMD powershell -file ..\MSS\DeployAndWait.ps1
035  
036  EXPOSE 86 443 500-55000

The commands on the lines in this Dockerfile are as follows:

Lines Description
005 - 006 Specifies the base image to use, which is the Enterprise Server base image.
008 Specify the metadata labels for the image that will be created. These labels can be queried using the docker inspect command.
011 - 014 Define build arguments passed by the docker build command:
  • ESPLATFORM. Either x86 or x64 indicating whether the CICS application will be running in a 32-bit or 64-bit environment respectively.
  • APPDIR. Specifies the folder in the image's filesystem that the CICS application is copied into. c:\app is used if this argument is not specified.
017 - 019 Copy the .zip files containing the CICS application source files to the relevant folders in the image's filesystem.
022 Sets the Docker working directory to be the directory containing the CICS application.
024 - 028 Runs a series of concatenated Windows commands to unzip the CICS application source files to the relevant folders in the image's filesystem then delete the .zip files.
030 Sets the Docker working directory to be the platform-specific folder into which you unzipped the CICS application source files.
032 Creates an environment variable to hold a value that indicates whether the CICS application will be running in a 32-bit or 64-bit environment.
034 Runs a PowerShell script to start the Micro Focus Directory Server (MFDS), deploy the region definitions, then application and display the console .log file for the region until the container is terminated.
036 Specifies the network ports that the container will listen on at run-time.