9.1 Setting Up the WebLogic Image Tool

Using the WebLogic Image Tool, you can create a new Oracle HTTP Server (OHS) image with Patch Set Updates (PSU’s) and interim patches, or update an existing image with one or more interim patches.

Administrators should be aware of the following recommendations:
  • Use Creating an Image for creating a new OHS image containing the OHS binaries, bundle patch and interim patches. This is the recommended approach if you have access to the OHS patches because it optimizes the size of the image.
  • Use Updating an Image for patching an existing OHS image with a single interim patch. Please note that the patched image size may increase considerably due to additional image layers introduced by the patch application tool.

9.1.1 WebLogic Image Tool Prerequisites

Verify that the environment where you will build the image meets the following prerequisites:
  • Docker client and daemon is installed, with minimum Docker version 18.03.1.ce.
  • Bash version 4.0 or later, to enable the command complete feature.
  • The JAVA_HOME environment variable set to the supported JDK location.

    Note:

    JDK 8 or higher is supported for WebLogic Image Tool.
    For example:
    export JAVA_HOME=/scratch/export/oracle/product/jdk

9.1.2 Configure the WebLogic Image Tool

To set up the WebLogic Image Tool:
  1. Create a working directory and navigate to it:
    mkdir <workdir>
    cd <workdir>
    For example:
    mkdir /scratch/imagetool-setup
    cd /scratch/imagetool-setup
  2. Download the latest version of the WebLogic Image Tool from the Releases page:
    wget https://github.com/oracle/weblogic-image-tool/releases/download/release-X.X.X/imagetool.zip
    where X.X.X is the latest release referenced on the Releases page.

    Note:

    You must use WebLogic Image Tool 1.14.3 or later.
  3. Unzip the release ZIP file in the imagetool-setup directory:
    unzip imagetool.zip
  4. Execute the following commands to set up the WebLogic Image Tool:
    cd <workdir>/imagetool-setup/imagetool/bin
    source setup.sh
    For example:
    cd /scratch/imagetool-setup/imagetool/bin
    source setup.sh

9.1.3 Validating the Setup

To validate the setup of the WebLogic Image Tool:
  1. Enter the following command to retrieve the version of the WebLogic Image Tool:
    imagetool --version
  2. Enter imagetool then press the Tab key to display the available imagetool commands:
    imagetool <TAB>
    The output will look similar to the following:
    cache   create  help    rebase  update

9.1.4 Setting the Build and Cache Directories

Optionally create the WebLogic Image Tool build and cache directories.

WebLogic Image Tool Build Directory

The WebLogic Image Tool creates a temporary Docker context directory, prefixed by wlsimgbuilder_temp, every time the tool runs. Under normal circumstances, this context directory will be deleted. However, if the process is aborted or the tool is unable to remove the directory, it is safe for you to delete it manually. By default, the WebLogic Image Tool creates the Docker context directory under the user’s home directory. If you prefer to use a different directory for the temporary context, set the environment variable WLSIMG_BLDDIR:
export WLSIMG_BLDDIR="/path/to/build/dir"

WebLogic Image Tool Cache Directory

The WebLogic Image Tool maintains a local file cache store. This store is used to look up where the OHS and JDK installers, and OHS patches reside in the local file system. By default, the cache store is located in the user’s $HOME/cache directory. Under this directory, the lookup information is stored in the .metadata file. All automatically downloaded patches also reside in this directory. You can change the default cache store location by setting the environment variable WLSIMG_CACHEDIR:
export WLSIMG_CACHEDIR="/path/to/cachedir"

9.1.5 Setting Up Additional Build Scripts

Creating an Oracle HTTP Server (OHS) container image using the WebLogic Image Tool requires additional container scripts for OHS domains.

  1. Clone the docker-images repository to set up the required scripts:
    cd <workdir>/imagetool-setup
    git clone https://github.com/oracle/docker-images.git
    For example:
    cd /scratch/imagetool-setup
    $ git clone https://github.com/oracle/docker-images.git