You can use the WebLogic Image Tool (WIT) to build your own WebLogic Server or Fusion Middleware Infrastructure images (with the latest Oracle Linux images, Java updates, and WebLogic Server patches), apply one-off patches to existing OCR images, or overlay your own files and applications on top of an OCR image.
Download and install the WebLogic Image Tool (WIT) following the
WIT Setup instructions.
Also, refer to the WIT Quick Start Guide. The
samples in this document assume that you have installed WIT in /tmp/imagetool
; you can choose to install it in any location.
The WebLogic Image Tool create
, update
, or rebase
commands supply
three different ways to generate a custom WebLogic Server installation image
from a base OS image (optionally, with WebLogic patches). In addition, the WIT createAuxImage
command
supports creating auxiliary images which
do not contain a WebLogic Server installation,
and instead, solely contain the WebLogic Deploy Tooling (WDT) installation and model files;
this option is designed for the Model in Image domain home source type.
Finally, you can use the WIT inspect
command to inspect images.
In detail:
WIT create
command:
create
command is not suitable for updating an existing domain home
in existing Domain in Image images
when the update is intended for a running domain. Use rebase
instead
or shut down the running domain entirely before applying the new image.
For more information, see Create a custom image with your domain inside the image.WIT rebase
command:
The rebase
command is used for Domain in Image
domains.
The new image can be created in one of two ways:
--recommendedPatches
option.WIT update
command:
--fromImage
parameter).
--pull
parameter for WIT,
and the --fromImage
parameter refers to an image in a repository,
and the repository image is newer than the locally cached version of the image,
then the command will download the repository image
to the local Docker cache and use it
instead of using the outdated local image.update
command results in a larger WebLogic Server image
due to the immutable layering in container images. For small updates, such as a one-off patch,
the increase in the image size may be negligible. However, for larger updates, the increase in size will be significant.
Consider using rebase
or create
to reduce the size impact of applying patches.update
command is not suitable for updating an existing domain home in
an existing Domain in Image image
when the update is intended for a running domain.
Use the WIT rebase
command instead
or shut down the running domain entirely before applying the new image.
For more information, see Apply patched images to a running domain.WIT createAuxImage
command:
WIT inspect
command:
All domain home source types require a base image which contains JDK and WebLogic Server binaries. This base image is usually obtained directly from the Oracle Container Registry, but, as needed, you can also create your own custom base image.
If you are using the Domain in Image domain home source type, then you will additionally need to use the base image to create a custom image with your domain inside the image.
Or, if you are using the Model in Image domain home source type without auxiliary images, then you will additionally need to use the base image to create a custom image with your model inside the image.
This section describes using the WebLogic Image Tool (WIT) create
command
to build a custom base WebLogic Server image.
This is sometimes necessary to build an image with a specific patch, and such,
but most use cases can instead, obtain pre-built
patched images directly from the Oracle Container Registry.
See
Obtain images from the Oracle Container Registry.
Here’s an example of using the WIT create command to create a base WebLogic Server image from a base Oracle Linux image, a WebLogic installer download, and a JRE installer download:
First, install the WebLogic Image Tool. This
sample assumes that you have installed WIT in /tmp/imagetool
; you can choose to install it in any location.
Download your desired JRE installer from the Oracle Technology Network Java downloads page or from the Oracle Software Delivery Cloud (OSDC).
Download your desired WebLogic Server installer from the Oracle Technology Network WebLogic Server installers page or from the Oracle Software Delivery Cloud (OSDC).
Note: The WebLogic Server installers will not be fully patched.
In a subsequent step, you’ll use
the WIT --patches
or --recommendedPatches
options
to apply one-off and recommended Oracle patches.
Add the installers to your WIT cache using the
cache
command.
For example, assuming you downloaded the installers to the /home/acmeuser/wls-installers
directory:
$ /tmp/imagetool/bin/imagetool.sh cache addInstaller \
--type=jdk \
--version=8u291 \
--path=/home/acmeuser/wls-installers/jre-8u291-linux-x64.tar.gz
$ /tmp/imagetool/bin/imagetool.sh cache addInstaller \
--type=wls \
--version=12.2.1.4.0 \
--path=/home/acmeuser/wls-installers/fmw_12.2.1.4.0_wls_Disk1_1of1.zip
For details, see the WIT Quick Start guide.
Use the create
command
to build the image using a default Oracle Linux image as its base, and download and apply the patches.
For example, use the following command to create a WebLogic Server image
named latest_weblogic:12.2.1.4
with:
$ /tmp/imagetool/bin/imagetool.sh create \
--tag latest_weblogic:12.2.1.4 \
--pull \
--jdkVersion=8u291 \
--type=wls \
--version=12.2.1.4.0 \
--recommendedPatches \
--user myusername@mycompany.com \
--passwordEnv=MYPWD
As another example, if you want to create a WebLogic Server image
named minimal_weblogic:12.2.1.3
with:
As of December, 2022, Fusion Middleware 12.2.1.3 is no longer supported. The last Critical Patch Updates (CPU) images for FMW Infrastructure 12.2.1.3 were published in October, 2022. Oracle has extended support of WebLogic Server 12.2.1.3, for six months only, for PSUs and security patches. CPU images for WebLogic Server 12.2.1.3 will be published in the January, 2023, and April, 2023, CPU cycles.
$ /tmp/imagetool/bin/imagetool.sh create \
--tag minimal_weblogic:12.2.1.3 \
--pull \
--jdkVersion=8u291 \
--type=wlsslim \
--version=12.2.1.3.0 \
--patches=29135930_12.2.1.3.0,27117282_12.2.1.3.0 \
--user myusername@mycompany.com \
--passwordEnv=MYPWD
Notes:
--user
and --passwordEnv
parameters (or one of the other password CLA options).
This example assumes that you have set the MYPWD
shell environment variable so that it contains your password.--type
parameter designates the Oracle product installation, such as WebLogic Server,
Fusion Middleware (FMW) Infrastructure, and such,
to include in the generated image. For example,
the wls
type corresponds to the WebLogic Server (WLS) generic installation,
the wlsslim
type to the WLS slim installation,
and the wlsdev
type to the WLS developer installation.
For a description of each installation type, see
WebLogic distribution installer type.--recommendedPatches
parameter finds and applies the latest PatchSet Update (PSU)
and recommended patches for each of the products included in the installer. For example, for WebLogic Server, the recommended patches for Coherence and TopLink are included.docker images
to view your image cache.--pull
parameter for WIT is passed to the container build engine which forces a check to the remote repository,
if applicable, prior to the build execution of the new image to update any image used during the build (updates dependencies).After the tool creates the image, verify that the image is in your local repository:
$ docker images
You can also inspect the contents of the image.
Oracle strongly recommends storing Domain in Image images in a private registry.
A container image that contains a WebLogic domain home has sensitive information
including credentials that are used to access external resources
(for example, a data source password),
and decryption keys
(for example, the DOMAIN_HOME/security/SerializedSystemIni.dat
domain secret file).
For more information,
see Container image protection.
The sample scripts in this section reference base image
container-registry.oracle.com/middleware/weblogic:12.2.1.4
.
This is an OCR General Availability (GA) image
which does not include the latest security patches for WebLogic Server.
GA images are intended for single desktop demonstration and development purposes only.
For all other purposes, Oracle strongly recommends using only images with the latest set of recommended patches applied,
such as OCR Critical Patch Updates (CPU) images or custom generated images.
See Ensure you are using recently patched images.
This section provides guidance for creating a new Domain in Image image. This type of image cannot be used in pods that must join the pods in an already running domain. If you need to create a Domain in Image image that is meant for updating an already running domain, then see Apply patched images to a running domain.
NOTE: The Domain in Image domain home source type is deprecated in WebLogic Kubernetes Operator version 4.0. Oracle recommends that you choose either Domain in PV or Model in Image, depending on your needs.
For Domain in Image domains,
you must create an image with the WebLogic domain inside the image.
Samples
are provided that demonstrate how to create the image using either
WLST to define the domain
or WebLogic Deploy Tooling models to define the domain.
In these samples, you will see a reference to a “base” or --fromImage
image.
You should use an image with the recommended security patches installed as this base image,
where this image could be an OCR image or a custom image.
See
Obtain images from the Oracle Container Registry
and
Create a custom image with patches applied.
The samples perform multiple steps for you using a single provided script and are not intended for production use. To help understand the individual steps, use the following step-by-step guidance for using WLST or WDT to create the domain home in Domain in Image.
Domain in Image using WDT:
Here we explore a step-by-step approach for Domain in Image
using WebLogic Deploy Tooling models to create the domain home.
These steps stage files to /tmp/dii-wdt-stage
,
assume the operator source is in /tmp/weblogic-kubernetes-operator
,
assume you have installed WIT in /tmp/imagetool
,
and generate a Domain in Image image named my-dii-wdt:v1
.
Domain in Image using WLST:
Here is a step-by-step approach for Domain in Image
images using WLST. These steps stage files to dii-wlst-stage
,
put the domain home inside the image at /u01/oracle/user_projects/domains/dii-wlst
,
assume the operator source is in /tmp/weblogic-kubernetes-operator
,
assume you have installed WIT in /tmp/imagetool
,
and name the final image my-dii-wlst:v1
.
Notes:
domain.properties
file include a sample WebLogic administration password.
These files must be protected and the sample password must be changed.--additionalBuildCommands
and --additionalBuildFiles
parameters for the WLST approach,
or the sample WDT model files provided in the WDT approach,
are not intended for production use.
These files can all change substantially in new versions of the operator
and must all be copied, preserved, and customized to suite your particular use case.NOTE: Model in Image without auxiliary images (the WDT model and installation files are included in the same image with the WebLogic Server installation) will be deprecated in WebLogic Kubernetes Operator version 4.0.7. Oracle recommends that you use Model in Image with auxiliary images. See Auxiliary images.
The example in this section references a base image,
container-registry.oracle.com/middleware/weblogic:12.2.1.4
.
This is an OCR General Availability (GA) image
which does not include the latest security patches for WebLogic Server.
GA images are intended for single desktop demonstration and development purposes only.
For all other purposes, Oracle strongly recommends using only images with the latest set of recommended patches applied,
such as OCR Critical Patch Updates (CPU) images or custom generated images.
See Ensure you are using recently patched images.
Example steps for creating a custom WebLogic image with a Model in Image file layer (using files from the Model in Image sample):
To gain an overall understanding of Model in Image domains, read the Model in Image User Guide and the Model in Image Sample. Note that the sample uses the recommended best approach, auxiliary images, instead of the alternative approach, which is used in this example.
Follow the prerequisite steps in the Model in Image Sample that describe how to:
/tmp/mii-sample
)./tmp/mii-sample/model-images
directory.
Both WDT and WIT are required to create your Model in Image container images.Locate or create a base WebLogic image.
See Obtain images from the Oracle Container Registry or Create a custom image with patches applied.
In the following step, you will use the container-registry.oracle.com/middleware/weblogic:12.2.1.4
GA image.
Build the final image using WIT while specifying the base image, target image tag, WDT installation location, and WDT model file locations. For example:
First, create a model ZIP file application archive and place it in the same directory where the sample model YAML file and model properties files are already staged:
$ rm -f /tmp/mii-sample/model-images/model-in-image__WLS-v1/archive.zip
$ cd /tmp/mii-sample/archives/archive-v1
$ zip -r /tmp/mii-sample/model-images/model-in-image__WLS-v1/archive.zip wlsdeploy
(The rm -f
command is included in case there’s an
old version of the archive ZIP file from a
previous run of this sample.)
Second, run the following WIT command:
$ cd /tmp/mii-sample/model-images
$ ./imagetool/bin/imagetool.sh update \
--tag model-in-image:WLS-v1 \
--fromImage container-registry.oracle.com/middleware/weblogic:12.2.1.4 \
--wdtModel ./model-in-image__WLS-v1/model.10.yaml \
--wdtVariables ./model-in-image__WLS-v1/model.10.properties \
--wdtArchive ./model-in-image__WLS-v1/archive.zip \
--wdtModelOnly \
--wdtDomainType WLS \
--chown oracle:root
Note: If using a Fusion Middleware Infrastructure base image,
then specify a --wdtDomainType
of JRF
or RestrictedJRF
,
JRF-v1
instead of WLS-v1
for the image tag,
and substitute each occurrence of model-in-image__WLS-v1
with model-in-image__JRF-v1
.
For an example Domain YAML file that sets up Model in Image to reference the image,
see /tmp/mii-sample/domain-resources/WLS/mii-initial-d1-WLS-v1.yaml
(or ./JRF/mii-initial-d1-JRF-v1.yaml
if using Fusion Middleware Infrastructure JRF
mode).
Notes:
The default values for domain.spec.configuration.model.wdtInstallHome
and .modelHome
reference the location of the WDT installation and model files that WIT copied into the image.
The domain type specified in domain.spec.configuration.model.domainType
must correspond with the --wdtDomainType
specified on the WIT command line when creating the image.
To compare this example with an equivalent auxiliary image domain:
$ diff /tmp/mii-sample/domain-resources/WLS-AI/mii-initial-d1-WLS-AI-v1.yaml \
/tmp/mii-sample/domain-resources/WLS/mii-initial-d1-WLS-v1.yaml