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 EDBTTAG
006  FROM microfocus/edbuildtools:${EDBTTAG}
007  
008  LABEL com.microfocus.is-example="true"
009  
010  # required arguments
011  ARG EDBTPLATFORM
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${EDBTPLATFORM}_export.zip "${APPDIR}\\MSS_export.zip"
019  COPY MSS "${APPDIR}\\MSS\\"
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_export.zip -Force -DestinationPath %APPDIR%" && \
026      del MSS_export.zip
027  
028  WORKDIR "${APPDIR}\\MSS${EDBTPLATFORM}"
029  
030  ENV EDBTPLATFORM=${EDBTPLATFORM}
031  
032  CMD ["powershell", "-file", "..\\MSS\\DeployAndWait.ps1", "-es_name", "MSS$($env:EDBTPLATFORM))"]
033  
034  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 Developer Build Tools for Windows 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:
  • EDBTPLATFORM. 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 - 026 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.
028 Sets the Docker working directory to be the platform-specific folder into which you unzipped the CICS application source files.
030 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.
032 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.
034 Specifies the network ports that the container will listen on at run-time.