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 FROM microfocus/entdevhub:rhel7_4.0_x64 006 007 ARG ESADM_USER=edadm 008 009 LABEL com.microfocus.is-base-image="false" 010 011 # Create user app and setup cobsetenv 012 USER root 013 014 RUN useradd -ms /bin/bash app && \ 015 usermod -aG $ESADM_USER app && \ 016 touch /etc/profile && \ 017 touch ~app/.bashrc && \ 018 echo ". ~/bin/cobsetenv_login" >>~app/.bashrc && \ 019 echo ". ~/bin/cobsetenv_login" >>~app/.bash_login 020 021 COPY sample_setup /home/app/bin/ 022 RUN chown -R app /home/app 023 024 USER app 025 ENV BASE /home/app/MSS 026 ENV CCITCP2_PORT 4790 027 WORKDIR "/home/app" 028 COPY MSS.tar.gz /home/app 029 COPY MSS64_export.tar.gz /home/app 030 RUN tar xvfp MSS.tar.gz && \ 031 tar xvfp MSS64_export.tar.gz 032 033 COPY cobsetenv_login /home/app/bin/ 034 035 EXPOSE 443 500-55000 036 037 CMD /home/app/bin/sample_setup
The commands on the lines in this Dockerfile are as follows:
Lines | Description |
---|---|
005 | Specifies the base image to use, which is the
Enterprise Developer base image.
On SUSE Linux the tag specified in the Dockerfile is sles12sp3_4.0_x64. |
007 | Define build arguments passed by the
docker build command:
|
009 | Specify the metadata labels for the image that will be created. These labels can be queried using the docker inspect command. |
012 | Sets the user to root. |
014 - 022 | Run a series of concatenated commands to add the Enterprise Server admin user and set up the shell to be used by that user. |
024 | Sets the user name to be used when running the image. |
025 - 026 | Create environment variables to be used in this Dockerfile:
|
027 | Sets the Docker working directory to be the folder where the CICS application source files are located. |
028 - 031 | Copy the .tar files containing the CICS application source files then extract the source files from them. |
033 | Copy the default environment that is to be used when someone logs on . |
035 | Specifies the network ports that the container will listen on at run-time. |
037 | Runs a 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. |