Using bld.bat to Create the Application Image

Use bld.bat to create an application image from the base image, including the files in AppContainerDirectory.

Usage

bld.bat IacceptEULA win_x64 app

Parameters

IacceptEULA
Indicates the acceptance of the End User License Agreement (EULA). This parameter is required.
win_x64
Create a Windows 64-bit image.
app
Build an image based on the extend image and includes the AppContainerDirectory.

Docker Specifications

bld.bat runs the following docker build command:

docker build
       --tag microfocus/extend-app:win_10.5.0_x64
       --build-arg BASEIMAGE=microfocus/extend:win_10.5.0_x64
       --build-arg EXTEND_VERSION="10.5.0"
       --build-arg APPCONTAINERDIRECTORY="C:\...\containerization\AppContainerDirectory"
       --file Dockerfile_win_x64_app
       .

Where:

--tag
Sets a name for the built application image, which includes "-app" to differentiate it from the base image.
--build-arg
Sets variables that get used in the Dockerfile specified by the --file option.
--file
Specifies the name of the Docker file that contains the application image creation commands.
.
Tells Docker to look for files and subdirectories in the current directory.

Dockerfile_win_x64_app

The Dockerfile_win_x64_app file contains the following commands to create the application image:

# Name of the repository tag used to create the application image
# Can be overridden with the --build-arg option in bld.bat
ARG BASEIMAGE=${BASEIMAGE}

# Use the base extend image to create the application image
FROM ${BASEIMAGE}

# Default Dockerfile values
# Values can be overridden with the --build-arg options in bld.bat
# These need to come after the FROM command or else they will not have a value
ARG EXTEND_VERSION=${EXTEND_VERSION}
ARG APPCONTAINERDIRECTORY=${APPCONTAINERDIRECTORY}

# Embed the label information into the application image for identification.
# This can be viewed with docker image inspect <image-id>
LABEL vendor="Micro Focus" \
      com.microfocus.name="extend-app" \
      com.microfocus.version="$EXTEND_VERSION" \
      com.microfocus.eula.url="https://supportline.microfocus.com/licensing/lvcontract.aspx" \
      com.microfocus.is-base-image="false"

# Use cmd.exe
SHELL ["cmd", "/S", "/C"]

# Copy the local application directory to the root directory of the image
COPY ["AppContainerDirectory", "C:/AppContainerDirectory/"]

# Set the starting directory when the image is run
WORKDIR C:/

If bld.bat runs without errors, you can use the following command to list all the images:

docker images

The application image has the following repository and tag name, including the suffix -app on the repository name to differentiate it from the base image:

REPOSITORY TAG
microfocus/extend-app win_10.5.0_x64