Creating a Base Image with bld.bat

Use bld.bat to run the extend installer silently to create a base image that includes the Windows Server Core base image for containers. The base image includes products for the Compiler, AcuRCL, AcuConnect, AcuToWeb, AcuServer, license files for these products.

Usage

bld.bat IacceptEULA win_x64

Parameters

IacceptEULA
Indicates the acceptance of the End User License Agreement (EULA). This parameter is required.
win_x64
Create a Windows 64-bit image.

Docker Build Command

bld.bat then runs the docker build command using the following syntax:

docker build ^
	--tag %BASEIMAGE% ^
	--build-arg BASEOSIMAGE=%BASEOSIMAGE% ^
	--build-arg ACCEPT_CONTAINER_EULA=%EULAARG% ^
	--build-arg ADDLOCAL="%ADDLOCAL%" ^
	--build-arg MSI="%MSI%" ^
	--build-arg EXTEND_VERSION="%EXTEND_VERSION%" ^
	--file %DOCKERFILE% ^
	.

Where:

--tag
Sets a name for the base image that gets built.
--build-arg
Sets variables that get used in the Dockerfile specified by the --file option.
--file
Specifies the name of the Dockerfile that contains the base image creation commands.
.
Sets the current directory as the directory in which to look for file and subdirectories.

Dockerfile_win_x64

The Dockerfile_win_x64 file contains the following commands to create the image:

Note: ARG specifies arguments that are used by other Dockerfile commands. Their values can be overridden with the --build-arg options to the Docker build command in bld.bat.
# Name of the repository tag used to create the base image
# Can be overridden with the --build-arg option in bld.bat
ARG BASEOSIMAGE=${BASEOSIMAGE}# Use the base operating system image to build the base extend image
FROM ${BASEOSIMAGE}

# 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 ACCEPT_CONTAINER_EULA=no
ARG ADDLOCAL=${ADDLOCAL}
ARG MSI=${MSI}
ARG EXTEND_VERSION=${EXTEND_VERSION}

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

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

# Copy the extend installer to the root directory
COPY ["${MSI}", "C:/"]

# Copy the 64-bit extend license files to the image
COPY ["aculic_win_x64", "C:/ProgramData/Micro Focus/extend/${VERSION}/x64/"]

# Install the extend products into the image
RUN	set MSI=${MSI} && \
	set ACCEPT_CONTAINER_EULA=${ACCEPT_CONTAINER_EULA} && \
	set ADDLOCAL=${ADDLOCAL} && \
	echo INFO: Installing %MSI% && \
	start "" /wait msiexec /i "%MSI%" ADDLOCAL=%ADDLOCAL% /qn

# Create a username and password
# The default username is ContainerAdministrator
RUN NET USER username "Password01!" /ADD

# Add username to the Administrators group
RUN NET LOCALGROUP "Administrators" "username" /ADD

# Add the extend bin directory to the PATH so it is available
# when the image is run.
RUN	set VERSION=${EXTEND_VERSION} && \
	setx PATH "%PATH%;%ProgramFiles%\Micro Focus\extend %VERSION%\AcuGT\bin;%ProgramFiles(x86)%\Micro Focus\extend %VERSION%\AcuGT\bin"

# 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 of the images:
docker images 

The base image has the following repository and tag name:

REPOSITORY TAG
microfocus/extend win_10.5.0_x64