The Dockerfile.prod File in the Hello World Docker Demonstration

This topic lists and describes the Dockerfile.prod file from the Hello World 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.

Note: The Dockerfiles supplied for Red Hat Linux and SUSE Linux differ slightly. The Dockerfile shown below is the one supplied with Red Hat Linux. Where there are differences between the two versions they are described in the following table.
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/cobolserver:rhel7_4.0_x64
006  
007  RUN useradd -ms /bin/bash app
008  ADD HelloWorld.tar.gz /home/app/
009  
010  USER app
011  WORKDIR /home/app
012  ENTRYPOINT ./HelloWorld

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

Lines Description
005 Specifies the base image to use, which is the COBOL Server base image.

On SUSE Linux the tag specified in the Dockerfile is sles12sp3_4.0_x64.

007 Runs the useradd command to add a new user called "app" with a login shell of /bin/bash.

On SUSE Linux, the corresponding action is achieved by a the RUN useradd and RUN chown commands on lines 9 and 10.

008 Copies the files for the Hello World application into the /home/app folder in the image's filesystem.

On SUSE Linux this command is on line 11.

010 - 012 Sets the user name to be used when running the image and specifies that running the image executes the Hello World application.

On SUSE Linux these commands are on lines 13 through 15.