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 JAVAZIPFILE=
006  
007  LABEL com.microfocus.third_parties.java="openjdk"
008  
009  # Copy java .tar.gz and setup PATH
010  COPY getAdoptOpenJDK.ps1 /
011  COPY ${JAVAZIPFILE} /
012  RUN cd / && \
013      powershell -command .\getAdoptOpenJDK.ps1 -download $False -unzip $True -CreateSetXBat $true && \
014      call env_setx.bat && \
015      set JAVAZIPFILE=${JAVAZIPFILE} && \
016      del \*.zip \*.ps1

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 Define build arguments passed by the docker build command:
  • JAVAZIPFILE. Specifies the name of the .zip file containing the files to provide Java support. This file is downloaded from the AdoptOpenJDK website by bld.bat.
007 Specify the metadata labels for the image that will be created. These labels can be queried using the docker inspect command.
010 - 016 Copy the OpenJDK .zip file and the getAdoptOpenJDK.ps1 PowerShell script, then run a series of concatenated Windows comments to set up the Java environment and delete any files that are no longer required.