Create or update an image

You can build an Oracle WebCenter Portal image for production deployments with patches (bundle or interim) using the WebLogic Image Tool, you must have access to the My Oracle Support (MOS) to download (bundle or interim) patches.

Create or update an Oracle WebCenter Portal Docker image using the WebLogic Image Tool

Using the WebLogic Image Tool, you can create a new Oracle WebCenter Portal Docker image (can include patches as well) or update an existing image with one or more patches (bundle patch and interim patches).

Recommendations:

  • Use create for creating a new Oracle WebCenter Portal Docker image:
    • without any patches
    • or, containing the Oracle WebCenter Portal binaries, bundle , and interim patches. This is the recommended approach if you have access to the Oracle WebCenter Portal patches because it optimizes the size of the image.
  • Use update for patching an existing Oracle WebCenter Portal Docker image with a single interim patch. Note that the patched image size may increase considerably due to additional image layers introduced by the patch application tool.
Prerequisites

Verify that your environment meets the following prerequisites:

  • Docker client and daemon on the build machine, with minimum Docker version 18.03.1.ce.
  • Bash version 4.0 or later, to enable the command complete feature.
  • JAVA_HOME environment variable set to the appropriate JDK location.
Set up the WebLogic Image Tool

To set up the WebLogic Image Tool:

  1. Create a working directory and change to it. In these steps, this directory is imagetool-setup.

    $ mkdir imagetool-setup
    $ cd imagetool-setup
    
  2. Download the latest version of the WebLogic Image Tool from the releases page.

  3. Unzip the release ZIP file to the imagetool-setup directory.

  4. Execute the following commands to set up the WebLogic Image Tool on a Linux environment:

    $ cd imagetool-setup/imagetool/bin
    $ source setup.sh
    
Validate 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>
    cache   create  help    rebase  update
    
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 is 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/buid/dir"
WebLogic Image Tool cache

The WebLogic Image Tool maintains a local file cache store. This store is used to look up where the Java, WebLogic Server installers, and WebLogic Server 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"
Set up additional build scripts

To create an Oracle WebCenter Portal Docker image using the WebLogic Image Tool, additional container scripts for Oracle WebCenter Portal domains are required.

  1. Clone the docker-images repository to set up those scripts. In these steps, this directory is DOCKER_REPO:

    $ cd imagetool-setup
    $ git clone https://github.com/oracle/docker-images.git
    
  2. Copy the additional WebLogic Image Tool build files from the operator source repository to the imagetool-setup location:

    $ mkdir -p imagetool-setup/docker-images/OracleWebCenterPortal/imagetool/12.2.1.4.0
    $ cd imagetool-setup/docker-images/OracleWebCenterPortal/imagetool/12.2.1.4.0
    $ cp -rf ${WORKDIR}/imagetool-scripts/* .
    

Note: To create the image, continue with the following steps. To update the image, see update an image.

Create an image

After setting up the WebLogic Image Tool and configuring the required build scripts, create a new Oracle WebCenter Portal Docker image using the WebLogic Image Tool as described ahead.

Download the Oracle WebCenter Portal installation binaries and patches

You must download the required Oracle WebCenter Portal installation binaries and patches listed below from the Oracle Software Delivery Cloud and save them in a directory of your choice. In these steps, the directory is download location.

The installation binaries and patches required for release 21.2.3 are:

  • JDK:

    • jdk-8u281-linux-x64.tar.gz
  • Fusion Middleware Infrastructure installer:

    • fmw_12.2.1.4.0_infrastructure.jar
  • WCP installers:

    • fmw_12.2.1.4.0_wcportal.jar
  • Fusion Middleware Infrastructure patches:

    • p28186730_139425_Generic.zip (OPatch)
    • p32253037_122140_Generic.zip(WLS)
    • p31544353_122140_Linux-x86-64.zip(WLS ADR Patch)
    • p32124456_122140_Generic.zip(Bundle patch for Oracle Coherence Version 12.2.1.4.7)
    • p31666198_122140_Generic.zip(OPSS Bundle Patch 12.2.1.4.200724)
    • p32357288_122140_Generic.zip(ADF BUNDLE PATCH 12.2.1.4.210107)
  • WCP patches:

    • p32224021_122140_Generic.zip(WCP BUNDLE PATCH 12.2.1.4.201126)
    • p31852495_122140_Generic.zip(WEBCENTER CORE BUNDLE PATCH 12.2.1.4.200905))
Update required build files

The following files in the code repository location <imagetool-setup-location>/docker-images/OracleWebCenterPortal/imagetool/12.2.1.4.0 are used for creating the image:

  • additionalBuildCmds.txt
  • buildArgs
  1. In the buildArgs file, update all occurrences of %DOCKER_REPO% with the docker-images repository location, which is the complete path of <imagetool-setup-location>/docker-images.

    For example, update:

    %DOCKER_REPO%/OracleWebCenterPortal/imagetool/12.2.1.4.0/

    to:

    <imagetool-setup-location>/docker-images/OracleWebCenterPortal/imagetool/12.2.1.4.0/

  2. Similarly, update the placeholders %JDK_VERSION% and %BUILDTAG% with appropriate values.

  3. Update the response file <imagetool-setup-location>/docker-images/OracleFMWInfrastructure/dockerfiles/12.2.1.4/install.file to add the parameter INSTALL_TYPE="Fusion Middleware Infrastructure" in the [GENERIC] section.

Create the image
  1. Add a JDK package to the WebLogic Image Tool cache:

    $ imagetool cache addInstaller --type jdk --version 8u281 --path <download location>/jdk-8u281-linux-x64.tar.gz
    
  2. Add the downloaded installation binaries to the WebLogic Image Tool cache:

    $ imagetool cache addInstaller --type fmw --version 12.2.1.4.0 --path <download location>/fmw_12.2.1.4.0_infrastructure.jar
    
    $ imagetool cache addInstaller --type wcp --version 12.2.1.4.0 --path <download location>/fmw_12.2.1.4.0_wcportal.jar
    
    
  3. Add the downloaded OPatch patch to the WebLogic Image Tool cache:

    $ imagetool cache addEntry --key 28186730_13.9.4.2.5 --value <download location>/p28186730_139425_Generic.zip
    
  4. Append the --opatchBugNumber flag and the OPatch patch key to the create command in the buildArgs file:

    --opatchBugNumber 28186730_13.9.4.2.5
    
  5. Add the downloaded product patches to the WebLogic Image Tool cache:

    $ imagetool cache addEntry --key 32253037_12.2.1.4.0 --value <download location>/p32253037_122140_Generic.zip
    
    $ imagetool cache addEntry --key 32124456_12.2.1.4.0 --value <download location>/p32124456_122140_Generic.zip
      
    $ imagetool cache addEntry --key 32357288_12.2.1.4.0 --value <download location>/p32357288_122140_Generic.zip
    
    $ imagetool cache addEntry --key 32224021_12.2.1.4.0 --value <download location>/p32224021_122140_Generic.zip
      
    $ imagetool cache addEntry --key 31666198_12.2.1.4.0 --value <download location>/p31666198_122140_Generic.zip
       
    $ imagetool cache addEntry --key 31544353_12.2.1.4.0 --value <download location>/p31544353_122140_Linux-x86-64.zip
      
    $ imagetool cache addEntry --key 31852495_12.2.1.4.0 --value <download location>/p31852495_122140_Generic.zip
    
  6. Append the --patches flag and the product patch keys to the create command in the buildArgs file. The --patches list must be a comma-separated collection of patch --key values used in the imagetool cache addEntry commands above.

    Sample --patches list for the product patches added in to the cache:

    --patches 32253037_12.2.1.4.0,32124456_12.2.1.4.0,32357288_12.2.1.4.0,32224021_12.2.1.4.0
    

    Example buildArgs file after appending the OPatch patch and product patches:

    create
    --jdkVersion=8u281
    --type wcp
    --version=12.2.1.4.0
    --tag=oracle/wcportal:12.2.1.4
    --pull
    --fromImage ghcr.io/oracle/oraclelinux:7-slim
    --additionalBuildCommands <imagetool-setup-location>/docker-images/OracleWebCenterPortal/imagetool/12.2.1.4.0/additionalBuildCmds.txt
    --additionalBuildFiles <imagetool-setup-location>/docker-images/OracleWebCenterPortal/dockerfiles/12.2.1.4/container-scripts
    --opatchBugNumber 28186730_13.9.4.2.5
    --patches 32253037_12.2.1.4.0,32124456_12.2.1.4.0,32357288_12.2.1.4.0,32224021_12.2.1.4.0,31666198_12.2.1.4.0,31544353_12.2.1.4.0,31852495_12.2.1.4.0
    

    Note: In the buildArgs file:

    • --jdkVersion value must match the --version value used in the imagetool cache addInstaller command for --type jdk.
    • --version value must match the --version value used in the imagetool cache addInstaller command for --type wcp.
    • --pull always pulls the latest base Linux image oraclelinux:7-slim from the Docker registry. This flag can be removed if you want to use the Linux image oraclelinux:7-slim, which is already available on the host where the WCP image is created.

    Refer to this page for the complete list of options available with the WebLogic Image Tool create command.

  7. Create the Oracle WebCenter Portal image:

    $ imagetool @<absolute path to buildargs file>
    

    Note: Make sure that the absolute path to the buildargs file is prepended with a @ character, as shown in the example above.

    For example:

    $ imagetool @<imagetool-setup-location>/docker-images/OracleWebCenterPortal/imagetool/12.2.1.4.0/buildArgs
    
    Click here to see the sample Dockerfile generated with the imagetool command.
  8. Check the created image using the docker images command:

      $ docker images | grep wcportal
    

Update an image

After setting up the WebLogic Image Tool and configuring the build scripts, use the WebLogic Image Tool to update an existing Oracle WebCenter Portal Docker image:

  1. Enter the following command to add the OPatch patch to the WebLogic Image Tool cache:

    $ imagetool cache addEntry --key 28186730_13.9.4.2.5 --value <downloaded-patches-location>/p28186730_139425_Generic.zip
    
  2. Execute the imagetool cache addEntry command for each patch to add the required patch(es) to the WebLogic Image Tool cache. For example, to add patch p30761841_122140_Generic.zip:

    $ imagetool cache addEntry --key=32224021_12.2.1.4.0 --value <downloaded-patches-location>/p32224021_122140_Generic.zip
    
  3. Provide the following arguments to the WebLogic Image Tool update command:

    • –-fromImage - Identify the image that needs to be updated. In the example below, the image to be updated is oracle/wcportal:12.2.1.4.
    • –-patches - Multiple patches can be specified as a comma-separated list.
    • --tag - Specify the new tag to be applied for the image being built.

    Refer here for the complete list of options available with the WebLogic Image Tool update command.

    Note: The WebLogic Image Tool cache should have the latest OPatch zip. The WebLogic Image Tool updates the OPatch if it is not already updated in the image.

    Examples
    Click here to see the example of update command:
    Click here to see the example Dockerfile generated by the WebLogic Image Tool with the --dryRun option:
  4. Check the built image using the docker images command:

      $ docker images | grep wcportal
      wcportal   12.2.1.4-30761841
      2ef2a67a685b        About a minute ago   3.58GB
      $
    

Create an Oracle WebCenter Portal Docker image using Dockerfile

For test and development purposes, you can create an Oracle WebCenter Portal image using the Dockerfile. Consult the README file for important prerequisite steps, such as building or pulling the Server JRE Docker image, Oracle Fusion Middleware Infrastructure Docker image and downloading the Oracle WebCenter Portal installer and bundle patch binaries.

A prebuilt Oracle Fusion Middleware Infrastructure image, container-registry.oracle.com/middleware/fmw-infrastructure:12.2.1.4, is available at container-registry.oracle.com. We recommend that you pull and rename this image to build the Oracle WebCenter Portal image.

  $ docker pull container-registry.oracle.com/middleware/fmw-infrastructure:12.2.1.4
  $ docker tag container-registry.oracle.com/middleware/fmw-infrastructure:12.2.1.4  oracle/fmw-infrastructure:12.2.1.4

To build an Oracle Fusion Middleware Infrastructure image and on top of that the Oracle WebCenter Portal image as a layer, follow these steps:

  1. Make a local clone of the sample repository:

    $ git clone https://github.com/oracle/docker-images
    
  2. Download the Oracle WebCenter Portal installer from the Oracle Technology Network or e-delivery.

    Note: Copy the installer binaries to the same location as the Dockerfile.

  3. Create the Oracle WebCenter Portal image by running the provided script:

    $ cd docker-images/OracleWebCenterPortal/dockerfiles
    $ ./buildDockerImage.sh -v 12.2.1.4 -s
    

    The image produced is named oracle/wcportal:12.2.1.4. The samples and instructions assume the Oracle WebCenter Portal image is named oracle/wcportal:12.2.1.4. You must rename your image to match this name, or update the samples to refer to the image you created.