The Dockerfile.jre File in the Docker Demonstration for the COBOL Server Base Image

This topic lists and describes the Dockerfile.jre file from the Docker demonstration for the COBOL Server base image. 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  
003  FROM microfocus/cobolserver:win_4.0_x64
004  
005  ARG JAVATARFILE=server-jre-8u162-windows-x64.tar.gz
006  ARG JAVAHOMEDIR=c:\\jdk1.8.0_162
007  
008  LABEL com.microfocus.third_parties.java="oraclejava8"
009  
010  # Copy java .tar.gz and setup PATH
011  ENV JAVA_HOME=${JAVAHOMEDIR}
012  ADD ${JAVATARFILE} /
013  
014  # Setup java
015  RUN setx /M PATH "%PATH%;%JAVA_HOME%\bin"

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

Lines Description
003 Specifies the base image to use, which is the COBOL Server base image.
005 - 006 Define build arguments passed by the docker build command:
  • JAVATARFILE. Specifies the name of the .tar file containing the files to provide Java support. This file is supplied in the VCBuildTools folder of the vc_build_tools_dockerfiles_4.0_windows.zip file. The files in it must be included in the image if Java support is required.
  • JAVAHOMEDIR. Specifies the name of the folder in the image's filesystem into which the files from the JAVATARFILE .tar file will be extracted.
008 Specify the metadata labels for the image that will be created. These labels can be queried using the docker inspect command.
011 - 012 Enables support for Java by unzipping the files in the file specified by JAVATARFILE and setting the JAVA_HOME environment variable.
015 Updates the PATH environment variable to include the folder containing the Java support files.