Code Monkey home page Code Monkey logo

weblogic-image-tool's Introduction

WebLogic Image Tool

Oracle is finding ways for organizations using WebLogic Server to run important workloads, to move those workloads into the cloud, and to simplify and speed up the application deployment life cycle. By adopting industry standards, such as Docker and Kubernetes, WebLogic now runs in a cloud neutral infrastructure. To help simplify and automate the creation of container images for WebLogic Server, we are providing this open source WebLogic Image Tool (WIT).

WIT let's you create a new Linux based image, with installations of a JDK and WebLogic Server, and optionally, configure a WebLogic domain with your applications, apply WebLogic Server patches, or update an existing image.

With the Image Tool you can:

  • Create a Docker image and install the requested Java and WebLogic software. And, you can create a WebLogic domain in the image, at the same time.
  • Create a new Docker image using an existing WebLogic domain from an existing image. The Docker image can start from an existing image with a JDK and Oracle middleware installation, or can install the JDK and Oracle Home as part of moving the domain.
  • Create a new Docker image by applying WebLogic patches to an existing image. In addition, if one did not exist previously, you can create a WebLogic domain, update an existing domain, or deploy an application.

For detailed information, see Image Tool.


Current production release

WebLogic Image Tool version and release information can be found here.

NOTE: The upcoming change to Oracle Support's recommended patches list will require
Image Tool 1.9.11 in order to use --recommendedPatches or --latestPSU.

Documentation

Documentation for WebLogic Image Tool is available here.

This documentation includes information for users and for developers.

Related projects

Contributing

This project welcomes contributions from the community. Before submitting a pull request, please review our contribution guide.

Security

Please consult the security guide for our responsible security vulnerability disclosure process.

License

Copyright (c) 2019, 2021 Oracle and/or its affiliates.

Released under the Universal Permissive License v1.0 as shown at https://oss.oracle.com/licenses/upl/.

weblogic-image-tool's People

Contributors

brahankv avatar carolynrountree avatar ddsharpe avatar dependabot[bot] avatar dldnh avatar gosurya-oracle avatar jshum2479 avatar lake-of-dreams avatar mriccell avatar rjeberhard avatar robertpatrick avatar rosemarymarano avatar spavlusieva avatar xiancao avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

weblogic-image-tool's Issues

mvn package fails with file not found

Running com.oracle.weblogic.imagetool.impl.meta.FileCacheStoreTest
java.io.IOException: Cache Directory does not exists /Users/xxxxx/cache

did not see that dir listed as dependency - should be either added to teh docs as needing to be manually created OR mvn process should create OR cache should not be in user home dir but should be in project dir (and in .gitignore)

Hooks to provide customized inputs

Need more details on the requirements and use case.

A couple of things have come up in the last few days:

  1. Need a hook prior to WDT createDomain to allow adding files that can be used with the WDT model @@file@@ token. The password file should not be copied to the final image.
  2. Need a hook to modify the Oracle Home after install to add security providers, modify scripts, etc.
  3. Run custom scripts during WLS patching (per patch instructions)

Applying recommended patches with imagetool

Now imagetool applies latest CPU patch (PSU) automatically when you provide option for that (--latestPSU).

This is noted in Critical Patch Update (CPU) Program Jan 2020 Patch Availability Document (PAD) (Doc ID 2602410.1)

WebLogic Server 12.2.1.4 home WLS Patch Set Update 12.2.1.4.191220 Patch 30689820 + Patch 30761841 CVE-2020-2550, CVE-2020-2551, CVE-2020-2708, CVE-2020-2544, CVE-2020-2547, CVE-2020-2519, CVE-2019-17359 Please apply Patch 30761841 on top of WLS PSU for CVE-2019-17359

So it would be a very nice feature to also have those recommended patches automatically applied by imagetool (without specifying exact patch number), maybe by an extra option like –recommended-patches. In this case patch 30761841. Would this be possible?

cache addPatch prefixes Patch with "null_12.2.1.3.0"

Hi,

after I have created a Docker Image with imagetool, the imagetool were adding the lastPSU correctly to the imagetool cache, but the patch is prefixed with "null_12.2.1.3.0".

imagetool cache listItems
Cache contents
cache.dir=/home/user/cache
jdk_8u211=/work/software/jdk-8u211-linux-x64.tar.gz
null_12.2.1.3.0=/home/user/cache/p29016089_122130_Generic.zip
wls_12.2.1.3.0=/work/software/fmw_12.2.1.3.0_wls_Disk1_1of1.zip
28186730_opatch=/home/user/cache/p28186730_139400_Generic.zip
29921455_12.2.1.3.0=/work/software/p29921455_12213190416_Generic.zip

the OPatch Patch p28186730_139400_Generic.zip is correctly prefixed with 28186730_opatch, but the latest PSU p29016089_122130_Generic.zip is prefixed with null_12.2.1.3.0
Would be cool, if you could display the Patch Number instead of null.

Cheers

Dirk

Add retry logic for operation against support site

We need to add retry logic for any operation aginst ARU, whether it is vadlidating patches, conflict checkers or actual downloading patches. Occassionally I received cryptic error messages or un-authorized message but retry again works fine.

tmp directory used for build context is fixed

Hello,

I was testing the command imagetool create and noticed that the temporary directory used for Docker build context is fixed to be inside my home directory: ${HOME}/wlsimgbuilder_tempXXXXXXX. In some cases this might me problematic: e.g. the home directory might be a mount of a shared remote filesystem and it may be easy to exceed disk quota building images there.

Would it make sense to add an option to override the path of this temporary directory? Or maybe providing a path under which the temporary directory will be created?

Question about 'imagetool cache addPatch' and passwords

Hello,

I'm testing the weblogic-image-tool and noticed that I need to provide a username/password of an Oracle Support account for adding a patch to the local cache using the imagetool cache addPatch command.

A pair of questions:

  • Is the transmission of the password secured (TLS)?
  • Could it be possible to remove the step of verification of the local patch file, in order to avoid providing any Oracle Support account credentials?

There are multiple patches found with id OPatch patch

ERROR:

[INFO ] Downloading patch 28186730... [WARNING] There are multiple patches found with id 28186730, please specify the format as one of the following for the release you want [WARNING] 28186730_13.9.4.2.0 [WARNING] 28186730_13.9.4.2.2 [WARNING] 28186730_13.9.4.2.1 [SEVERE ] Response code: -1, message: Multiple patches with same patch number detected [oracle@ebsasserter bin]$

Server is running in Development Mode and the System Console to read the password securely from the command line was not found.

While starting MS getting below error :

Starting WLS with line:
/u01/jdk/bin/java -server -Xms256m -Xmx512m -XX:CompileThreshold=8000 -cp /u01/oracle/wlserver/server/lib/weblogic-launcher.jar -Dlaunch.use.env.classpath=true -Dweblogic.Name=ms-1 -Djava.security.policy=/u01/oracle/wlserver/server/lib/weblogic.policy -Djava.system.class.loader=com.oracle.classloader.weblogic.LaunchClassLoader -javaagent:/u01/oracle/wlserver/server/lib/debugpatch-agent.jar -da -Dwls.home=/u01/oracle/wlserver/server -Dweblogic.home=/u01/oracle/wlserver/server -Dweblogic.management.server=http://ebsasserter.subnet.vcn.oraclevcn.com:7001 weblogic.Server
<Jan 26, 2020 12:36:52 PM GMT> <Disabling the CryptoJ JCE Provider self-integrity check for better startup performance. To enable this check, specify -Dweblogic.security.allowCryptoJDefaultJCEVerification=true.>
<Jan 26, 2020 12:36:52 PM GMT> <Changing the default Random Number Generator in RSA CryptoJ from ECDRBG128 to HMACDRBG. To disable this change, specify -Dweblogic.security.allowCryptoJDefaultPRNG=true.>
<Jan 26, 2020 12:36:52 PM GMT> <The following extensions directory contents added to the end of the classpath:
/u01/oracle/Middleware/domains/asr_domain/lib/fndext.jar.>
<Jan 26, 2020 12:36:54 PM GMT> <Starting WebLogic Server with Java HotSpot(TM) 64-Bit Server VM Version 25.211-b12 from Oracle Corporation.>
<Jan 26, 2020 12:36:54 PM GMT> <"ResourceManagement" is not enabled in this JVM. Enable "ResourceManagement" to use the WebLogic Server "Resource Consumption Management" feature. To enable "ResourceManagement", you must specify the following JVM options in the WebLogic Server instance in which the JVM runs: -XX:+UnlockCommercialFeatures -XX:+ResourceManagement.>
<Jan 26, 2020 12:36:54 PM GMT>
Enter username to boot WebLogic server:<Jan 26, 2020 12:36:54 PM GMT>
<Server is running in Development Mode and the System Console to read the password securely from the command line was not found.
The System Console is not present if stdin, stdout, or stderr is redirected when starting WebLogic Server.>
<Jan 26, 2020 12:36:54 PM GMT>
<Jan 26, 2020 12:36:54 PM GMT>
[oracle@ebsasserter bin]$

command i used to create domain:
cd /u01/install/projects/tools/imagetool/bin
. ./setup.sh
export JAVA_HOME=/u01/install/software/jdk1.8.0_211
export PATH=$JAVA_HOME/bin:$PATH
imagetool create --tag wls:12.2.1.3.0 --latestPSU --version 12.2.1.3.0 --jdkVersion=8u211 --wdtModel=/u01/install/software/sample.yaml --wdtVariables=/u01/oracle/properties/domain.properties --wdtArchive /u01/install/software/archive.zip --wdtDomainHome /u01/oracle/Middleware/domains/asr_domain --wdtVersion 1.6.2 --chown oracle:oinstall --additionalBuildCommands=/u01/install/projects/tools/imagetool/bin/buildargs --user maheswar@******.com --password *********

Start MS:
docker run -d --name ms-1 --link ebsasserter:ebsasserter --network=SampleNET -p 8001:8001 -v /u01/oracle/properties/domain.properties:/u01/oracle/properties -e MS_NAME=ms-1 wls:12.2.1.3.0 /u01/oracle/Middleware/domains/asr_domain/bin/startManagedWebLogic.sh ms-1 http://ebsasserter.subnet.vcn.oraclevcn.com:7001

start ADMIN Server:
docker run -d --name ebsasserter --hostname ebsasserter --network=SampleNET -v /u01/oracle/properties/domain.properties:/u01/oracle/properties -p 7001:7001 wls:12.2.1.3.0

Probably a mistake in the quickstart.md

In the quickstart's section Creating an image with no Internet Access, there's a command to add the latest OPatch to the cache: imagetool cache addPatch --patchId p28186730 --version 13.9.4.0.0 --path /home/acmeuser/cache/p28186730_139400_Generic.zip. This command specifies --version 13.9.4.0.0, which is the version of the OPatch, but the documentation of the command imagetool cache addPatch (as per running imagetool cache addPatch help) indicates that the argument --version refers to the version of mw this patch is for. Ex: 12.2.1.3.0. So it seems to be inconsistent.

Additionally, if I add an Oracle Support user credentials to the command and let it verify the integrity of the patch file, with the following command:

$ imagetool cache addPatch \
    --patchId p28186730 \
    --version 13.9.4.0.0 \
    --path "${CACHE_DIR}/p28186730_139400_Generic.zip" \
    --user ${ORACLE_SUPPORT_USER} \
    --password ${ORACLE_SUPPORT_PASSWORD}

I get the following error:

Exception in thread "main" picocli.CommandLine$ExecutionException: Error while calling command (com.oracle.weblogic.imagetool.cli.cache.AddPatchEntry@363ee3a2): java.io.IOException: Failed to determine release number for category wls, version 13.9.4.0.0
        at picocli.CommandLine.execute(CommandLine.java:1063)
        at picocli.CommandLine.access$900(CommandLine.java:142)
        at picocli.CommandLine$RunLast.handle(CommandLine.java:1246)
        at picocli.CommandLine$RunLast.handle(CommandLine.java:1214)
        at picocli.CommandLine$AbstractParseResultHandler.handleParseResult(CommandLine.java:1122)
        at picocli.CommandLine.parseWithHandlers(CommandLine.java:1405)
        at com.oracle.weblogic.imagetool.cli.WLSCommandLine.call(WLSCommandLine.java:37)
        at com.oracle.weblogic.imagetool.cli.WLSCommandLine.call(WLSCommandLine.java:16)
        at com.oracle.weblogic.imagetool.cli.CLIDriver.main(CLIDriver.java:50)
Caused by: java.io.IOException: Failed to determine release number for category wls, version 13.9.4.0.0
        at com.oracle.weblogic.imagetool.util.ARUUtil.getReleaseNumber(ARUUtil.java:503)
        at com.oracle.weblogic.imagetool.util.ARUUtil.getPatchDetail(ARUUtil.java:292)
        at com.oracle.weblogic.imagetool.cli.cache.AddPatchEntry.validateAndAddToCache(AddPatchEntry.java:86)
        at com.oracle.weblogic.imagetool.cli.cache.AddPatchEntry.call(AddPatchEntry.java:58)
        at com.oracle.weblogic.imagetool.cli.cache.AddPatchEntry.call(AddPatchEntry.java:27)
        at picocli.CommandLine.execute(CommandLine.java:1056)
        ... 8 more

which I suppose is related to the --version argument.

If I change --version to the WLS version 12.2.1.3.0 and also add --type wls, the following is the complete command I run and its resulting error:

$ imagetool cache addPatch \
    --type wls \
    --version 12.2.1.3.0 \
    --patchId p28186730 \
    --path "${CACHE_DIR}/p28186730_139400_Generic.zip" \
    --user ${ORACLE_SUPPORT_USER} \
    --password ${ORACLE_SUPPORT_PASSWORD}
[2019-06-14 15:36:05] [com.oracle.weblogic.imagetool.cli.CLIDriver] [SEVERE ] Response code: -1, message: Unable to find patchId p28186730 on Oracle Support

It seems that for now, the only working way of adding the latest OPatch patch to the cache is using the offline version of the command, without specifying the arguments --username and --password.

I'm using the release 1.0.0

Could the tool assume that the `--fromImage` image includes JDK?

Currently, the imagetool create tool will build a Docker image that will install a desired version of JDK during its building process.

Would it be possible for the tool to assume that the base Docker image provided as --fromImage already comes with an installation of JDK, and use its environment variable JAVA_HOME for locating the Java binaries and running Java commands?

Jre instead of JDK

Hi,
To build a weblogic images only JRE is required( correct me if i am wrong) but this tool allows only with Jdk, is there any possibilities to have only server jre ?

Thanks

Tool still requires JDK even if the base image includes JDK installation

Version of WebLogic Image Tool: 1.1.0

I'm trying to build an image using imagetool create and providing a base image (with --fromImage) which already includes an installation of JDK and environment variable JAVA_HOME set. But when I run the image creation command, it still throws an error indicating that I need to download the JDK installer and put it in the cache. You can see the command I used and the output:

$ imagetool create \
    --docker=docker \
    --fromImage=${BASE_IMAGE_WITH_JDK} \
    --tag=wls:12.2.1.3 \
    --patches ${patch_psu_id},${patch_struts2_id},${patch_jdbc_id}
[2019-07-11 16:51:15] [com.oracle.weblogic.imagetool.cli.menu.ImageOperation] [INFO   ] tmp directory used for docker build context: /tmp/wlsimgbuilder_temp4478144662286527431
[2019-07-11 16:51:18] [com.oracle.weblogic.imagetool.cli.CLIDriver] [SEVERE ] Response code: -1, message: Please download the installer manually and put it in the cache  jdk_8u202

The previous command does work when I add the JDK installer to the cache and use the argument --jdkVersion to point to it, and the resulting image seems to skip its installation and uses the one provided in the base image.

Is this the expected behaviour?

additionalBuildCommands does not support COPY / Add support to include additional files in build context

The imagetool currently creates a temporary directory that functions as the build context for Docker (wlsimgbuilder_temp*) and copies over the relevant cache items to this temp directory (jdk, wls) but nothing else.
As a result, it is currently not possible to use COPY commands in the additionalBuildCommands (which depends on files being available in the Docker build context) as there is currently no option to include those in the list of items the imagetool copies over to that temp directory.

Please provide option to set inventory file location

We have the need to provide different inventory location and group in the inventory file. Right now imagetool has hard coded inventory location.

It would be really helpful if the variable is configurable when installing 12.2.1.3 bundle and patches.

Fail to COPY files from local filesystem to Docker image with imagetool

Is there a way to copy external files (from local filesystem) to docker image with weblogic imagetool and/or weblogic deploying-tool.
Tries argument –additionalBuildCommands to “imagetool create” but could not get it working as only build context filesystem seem to be available.

Trying with this file for additionalBuildCommands:
[final-build-commands]
LABEL owner="TFGP middleware team"
COPY --chown=oracle:oracle documentDetails.properties /u01/domains/simple/

Output from imagetool:
Step 51/51 : COPY --chown=oracle:oracle documentDetails.properties /u01/domains/simple/

[SEVERE ] Response code: -1, message: docker command failed with error: Failed to build image: COPY failed: stat /opt/apps/docker/tmp/docker-builder872733021/documentDetails.properties: no such file or directory

Imagetool seem to prepend pathname with /opt/apps/docker/tmp/docker-builder872733021/.

If this is not possible to fix what is suggested way to copy a file with imagetool or createDomain tool?

[SEVERE ] Response code: -1, message: Please download the installer manually and put it in the cache jdk_8u202

How can I get image tool to use jdk-8u221 (present in the cache) and not jdk-8u202 (not present in the cache) ?

$ docker image ls
REPOSITORY TAG IMAGE ID CREATED SIZE
container-registry.oracle.com/os/oraclelinux 7-slim b19454a5f17a 9 months ago 117MB

$ imagetool cache listItems
Cache contents
cache.dir=/u01/oracledocker/wlsimg_cachedir
jdk_8u221=/u01/stage/jdk-8u221-linux-x64.tar.gz
wls_12.2.1.3.0=/u01/stage/fmw_12.2.1.3.0_infrastructure.jar

$ imagetool create --fromImage oraclelinux:7-slim --tag wls:12.2.1.3.0 --version 12.2.1.3.0

[INFO ] Temporary directory used for docker build context: /u01/oracledocker/build/wlsimgbuilder_temp8126783846356421133
[SEVERE ] Response code: -1, message: Please download the installer manually and put it in the cache jdk_8u202

Small mistake in the 'imagetool cache addPatch' error output

I'm using the latest WebLogic Image Tool version 1.1.0 and I think that the output of the tool imagetool cache addPatch has a small mistake. I provided the patchId in a wrong format 29016089_122130 instead of 29016089_12.2.1.3.0, and here is the error message I get:

[2019-07-11 15:36:17] [com.oracle.weblogic.imagetool.util.Utils] [SEVERE ] Invalid patch id 12345678_12.2.1.3.0. Patch id must be in the format of 29016089_122130 starting with 8 digits patch ID.  The release version as found by searching for patches on Oracle Support Site must be specified after the underscore with 5 places such as 12.2.1.3.0 or 12.2.1.3.190416

In the beginning of the message, I think it should instead say: Invalid patch id 29016089_122130. Patch id must be in the format of 12345678_12.2.1.3.0

failed to parse stage name "OS_UPDATE"

I cannot get the basics working following the Quickstart.

imagetool @pwd/build_args
[INFO ] Image Tool build ID: bcc0dfdc-e9e0-44e8-9cd0-39b7dfee6f52
[INFO ] Temporary directory used for docker build context: /root/wlsimgbuilder_temp2187368807883469017
[INFO ] copying /tmp/jdk-8u251-linux-x64.tar.gz to build context folder.
[INFO ] Using middleware installers (wls) version 12.2.1.4.0
[INFO ] copying /tmp/fmw_12.2.1.4.0_wls.jar to build context folder.
[INFO ] docker cmd = docker build --force-rm=true --no-cache --tag ets-wls:12.2.1.4.0 /root/wlsimgbuilder_temp2187368807883469017
[SEVERE ] Response code: -1, message: docker command failed with error: #2 [internal] load .dockerignore
#2 transferring context: 2B done
#2 DONE 0.0s

#1 [internal] load build definition from Dockerfile
#1 transferring dockerfile: 2.60kB done
#1 DONE 0.0s
failed to solve with frontend dockerfile.v0: failed to create LLB definition: failed to parse stage name "OS_UPDATE": invalid reference format: repository name must be lowercase

cat build_args
create
--type wls
--version 12.2.1.4.0
--jdkVersion 8u251
--tag ets-wls:12.2.1.4.0
--dryRun

"oel7:7-slim as OS_UPDATE" is not a valid repository/tag: invalid reference format

How do I prevent imagetools's "invalid reference format" ?

$ docker image ls
REPOSITORY TAG IMAGE ID CREATED SIZE
oel7 7-slim 874477adb545 3 weeks ago 118 MB
oel7 slim 874477adb545 3 weeks ago 118 MB
oel7 latest 5f993b1aafe5 3 weeks ago 235 MB

$ imagetool cache listItems
Cache contents
cache.dir=/u01/oracledocker/wlsimg_cachedir
jdk_8u221=/u01/oracledocker/stage/jdk-8u221-linux-x64.tar.gz
wls_12.2.1.3.0=/u01/stage/fmw_12.2.1.3.0_infrastructure.jar
wdt_1.3.0=/u01/oracledocker/stage/weblogic-deploy-1-3-0.zip

]$ docker version
Client:
Version: 1.13.1
API version: 1.26
Package version: docker-1.13.1-96.gitb2f74b2.el7.x86_64
Go version: go1.10.8
Git commit: b2f74b2/1.13.1
Built: Tue Apr 2 21:01:07 2019
OS/Arch: linux/amd64

Server:
Version: 1.13.1
API version: 1.26 (minimum version 1.12)
Package version: docker-1.13.1-96.gitb2f74b2.el7.x86_64
Go version: go1.10.8
Git commit: b2f74b2/1.13.1
Built: Tue Apr 2 21:01:07 2019
OS/Arch: linux/amd64
Experimental: false

$ imagetool create --fromImage=oel7:7-slim --jdkVersion=8u221 --tag=wls:12.2.1.3.0 --version=12.2.1.3.0
[INFO ] Temporary directory used for docker build context: /u01/oracledocker/build/wlsimgbuilder_temp4698535419410021917
[INFO ] docker cmd = docker build --force-rm=true --no-cache --tag wls:12.2.1.3.0 --build-arg WLS_PKG=fmw_12.2.1.3.0_infrastructure.jar --build-arg JAVA_PKG=jdk-8u221-linux-x64.tar.gz /u01/oracledocker/build/wlsimgbuilder_temp4698535419410021917
Sending build context to Docker daemon 1.823 GB

Step 1/35 : FROM oel7:7-slim as OS_UPDATE
[SEVERE ] Response code: -1, message: docker command failed with error: Error parsing reference: "oel7:7-slim as OS_UPDATE" is not a valid repository/tag: invalid reference format

The tool leaves leftover Docker images after image generation

After the tool imagetool create performs its job, there are leftover Docker images in the system.

It may be necessary to check them from time to time to remove them to prevent going out of space in the system. The quickstart of the tool's documentation (cleanup section) suggests to run docker rmi $(docker images --filter "dangling=true" -q --no-trunc) to remove the leftover images.

But, maybe the tool could keep track of the generated intermediate images and clean them by itself?

'imagetool create --chown' is failing

Version of WebLogic Image Tool: 1.1.0

I'm testing the new --chown argument for the imagetool create tool, but it's failing for me. Below you can see the command I use and its output:

$ imagetool create \
    --docker=docker \
    --fromImage=${BASE_IMAGE_WITH_JDK} \
    --jdkVersion=${JDK_VERSION} \
    --tag=wls:12.2.1.3 \
    --patches ${patch_psu_id},${patch_struts2_id},${patch_jdbc_id} \
    --chown=wls:ci
[2019-07-11 17:01:10] [com.oracle.weblogic.imagetool.cli.menu.ImageOperation] [INFO   ] tmp directory used for docker build context: /tmp/wlsimgbuilder_temp3962757257988397254
[2019-07-11 17:01:14] [com.oracle.weblogic.imagetool.cli.menu.CreateImage] [INFO   ] JAVA_HOME detected in base image, skipping JDK install: /usr/oracle/jdk-1.8.0_212
[2019-07-11 17:01:14] [com.oracle.weblogic.imagetool.util.ARUUtil] [WARNING] No credentials provided, skipping validation of patches
[2019-07-11 17:01:14] [com.oracle.weblogic.imagetool.cli.menu.CreateImage] [INFO   ] patch conflict check successful
[2019-07-11 17:01:15] [com.oracle.weblogic.imagetool.cli.menu.CreateImage] [INFO   ] docker 
[...]
Step 4/30 : RUN if [ -z "$(getent group ci)" ]; then hash groupadd &> /dev/null && groupadd ci || exit -1 ; fi  && if [ -z "$(getent passwd wls)" ]; then hash useradd &> /dev/null && useradd -g ci wls || exit -1; fi  && mkdir /u01  && chown wls:ci /u01
 ---> Running in 2a55ecb751c0
Removing intermediate container 2a55ecb751c0
 ---> 25b4320ae9f1
Step 5/30 : FROM OS_UPDATE as WLS_BUILD
 ---> 25b4320ae9f1
Step 6/30 : ARG WLS_PKG
 ---> Running in 915d56a8873e
Removing intermediate container 915d56a8873e
 ---> 647d53627d19
Step 7/30 : ARG INV_LOC
 ---> Running in cda039a838e4
Removing intermediate container cda039a838e4
 ---> e63c9d844719
Step 8/30 : ARG WLS_RESP
 ---> Running in a898af2903db
Removing intermediate container a898af2903db
 ---> 182e6909e6aa
Step 9/30 : ARG ORACLE_HOME=/u01/oracle
 ---> Running in 9946d645eef8
Removing intermediate container 9946d645eef8
 ---> 40b308d8065c
Step 10/30 : ARG ORAINST
 ---> Running in b420c4b177d5
Removing intermediate container b420c4b177d5
 ---> a802def2a468
Step 11/30 : ARG PATCHDIR
 ---> Running in f4b27cb16379
Removing intermediate container f4b27cb16379
 ---> 7c366b4e0c8a
Step 12/30 : ENV WLS_PKG=${WLS_PKG:-fmw_12.2.1.3.0_wls_Disk1_1of1.zip}     JAVA_HOME=/usr/oracle/jdk-1.8.0_212     ORACLE_HOME=${ORACLE_HOME:-/u01/oracle}     INV_LOC=${INV_LOC:-/u01/oracle/oraInventory}     WLS_RESP=${WLS_RESP:-wls.rsp}     ORAINST=${ORAINST:-oraInst.loc}     OPATCH_NO_FUSER=true     PATCHDIR=${PATCHDIR:-patches}
 ---> Running in ae4c2c1bb728
Removing intermediate container ae4c2c1bb728
 ---> af0d47003d3b
Step 13/30 : COPY --chown=wls:ci $WLS_PKG $WLS_RESP /tmp/delme/
 ---> be54f0501f00
Step 14/30 : COPY --chown=wls:ci $ORAINST $INV_LOC/
 ---> 7b4b8c5feae2
Step 15/30 : COPY --chown=oracle:oracle p28186730_139400_Generic.zip /tmp/delme/opatch/
[2019-07-11 17:02:01] [com.oracle.weblogic.imagetool.cli.CLIDriver] [SEVERE ] Response code: -1, message: docker command failed with error: unable to convert uid/gid chown string to host mapping: can't find gid for group oracle: no such group: oracle

docker image size increases significantly during patching in the update option

We don't see any significant increase in docker image size with create command even after lot of patches are applied. But there is significant increase in docker image size with the update command even with single patch. Its almost 1GB increase. This is a major blocker for us as we update our images very often.

ADMIN Server not starting

I created WLS domain image using imagetool

Here is the completed log:

COMPLETED LOG:
####<Jan 17, 2020 5:59:11 AM> <The WebLogic Deploy Tooling createDomain version is 1.6.2:master.ca8476a:Dec 16, 2019 23:54 UTC>
####<Jan 17, 2020 5:59:12 AM> <__validate_model_file> <Performing validation in TOOL mode for WebLogic Server version 12.2.1.3.0 and WLST OFFLINE mode>
####<Jan 17, 2020 5:59:12 AM> <__validate_model_file> <Performing model validation on the /u01/wdt/models/sample.yaml model file>
####<Jan 17, 2020 5:59:12 AM> <__validate_model_file> <Performing archive validation on the /u01/wdt/models/archive.zip archive file>
####<Jan 17, 2020 5:59:12 AM> <__validate_model_section>
####<Jan 17, 2020 5:59:12 AM> <__validate_model_section>
####<Jan 17, 2020 5:59:12 AM> <__validate_model_section>
####<Jan 17, 2020 5:59:13 AM> <__validate_model_section>
####<Jan 17, 2020 5:59:13 AM> <filter_helper> <apply_filters> <No filter configuration file /u01/wdt/weblogic-deploy/lib/model_filters.json>
####<Jan 17, 2020 5:59:13 AM> <__create_domain>
####<Jan 17, 2020 5:59:13 AM> <__create_domain_with_select_template>
####<Jan 17, 2020 5:59:14 AM> <__create_domain_with_select_template>
####<Jan 17, 2020 5:59:17 AM> <__set_domain_name>
####<Jan 17, 2020 5:59:17 AM> <_create_named_mbeans>
####<Jan 17, 2020 5:59:18 AM> <create_placeholder_named_elements>
####<Jan 17, 2020 5:59:18 AM> <_create_named_mbeans>
####<Jan 17, 2020 5:59:18 AM> <create_placeholder_named_elements>
####<Jan 17, 2020 5:59:18 AM> <_create_named_mbeans>
####<Jan 17, 2020 5:59:18 AM> <_create_named_mbeans>
####<Jan 17, 2020 5:59:19 AM> <_create_named_mbeans> <Updating MigratableTarget with the name asrPOCserver1 (migratable)>
####<Jan 17, 2020 5:59:19 AM> <_create_mbean>
####<Jan 17, 2020 5:59:19 AM> <__create_domain_with_select_template>
####<Jan 17, 2020 5:59:23 AM> <install_domain_libraries> <Installing domain library wlsdeploy/domainLibraries/fndext.jar from archive to lib directory of /u01/oracle/Middleware/domains/asr_domain>
####<Jan 17, 2020 5:59:23 AM> <extract_classpath_libraries> <The archive file /u01/wdt/models/archive.zip contains no classpath libraries to install>
####<Jan 17, 2020 5:59:23 AM> <install_domain_scripts>
####<Jan 17, 2020 5:59:23 AM> <_add_named_elements>
####<Jan 17, 2020 5:59:23 AM> <_add_model_elements>
####<Jan 17, 2020 5:59:23 AM> <_add_model_elements>
####<Jan 17, 2020 5:59:23 AM> <_add_model_elements>
####<Jan 17, 2020 5:59:23 AM> <_add_model_elements>
####<Jan 17, 2020 5:59:23 AM> <_add_named_elements>
####<Jan 17, 2020 5:59:23 AM> <__add_applications>

Issue Log for createDomain version 1.6.2 running WebLogic version 12.2.1.3.0 offline mode:

Total: WARNING : 0 SEVERE : 0

createDomain.sh completed successfully (exit code = 0)
Removing intermediate container 97d3a7e97826
---> 3c7fa33e41ef
Step 38/50 : FROM OS_UPDATE as FINAL_BUILD
---> 9bf864ae8de8
Step 39/50 : ARG ADMIN_NAME
---> Running in fb1a73be2250
Removing intermediate container fb1a73be2250
---> 18bc725abcb8
Step 40/50 : ARG ADMIN_HOST
---> Running in ece9db837918
Removing intermediate container ece9db837918
---> 4e1d2aeadabd
Step 41/50 : ARG ADMIN_PORT
---> Running in 4e5320d75523
Removing intermediate container 4e5320d75523
---> 7cafc531a44d
Step 42/50 : ARG MANAGED_SERVER_PORT
---> Running in 5b13eaea3560
Removing intermediate container 5b13eaea3560
---> 033c68b95253
Step 43/50 : ENV ORACLE_HOME=/u01/oracle JAVA_HOME=/u01/jdk ADMIN_NAME=${ADMIN_NAME:-admin-server} ADMIN_HOST=${ADMIN_HOST:-wlsadmin} ADMIN_PORT=${ADMIN_PORT:-7001} MANAGED_SERVER_NAME=${MANAGED_SERVER_NAME:-} MANAGED_SERVER_PORT=${MANAGED_SERVER_PORT:-8001} DOMAIN_HOME=/u01/oracle/Middleware/domains/asr_domain LC_ALL=${DEFAULT_LOCALE:-en_US.UTF-8} PROPERTIES_FILE_DIR=/u01/oracle/properties PATH=${PATH}:/u01/jdk/bin:/u01/oracle/oracle_common/common/bin:/u01/oracle/wlserver/common/bin:/u01/oracle:$/u01/oracle/Middleware/domains/asr_domain/bin
---> Running in 8fe80d380df0
Removing intermediate container 8fe80d380df0
---> 622db12798ba
Step 44/50 : LABEL com.oracle.weblogic.imagetool.buildid="206ea75b-5def-4710-a0c4-38f2c19931d1"
---> Running in 987ed8db54a2
Removing intermediate container 987ed8db54a2
---> 65c404f3e047
Step 45/50 : COPY --from=JDK_BUILD --chown=oracle:oinstall /u01/jdk /u01/jdk/
---> 8b3b46a623a7
Step 46/50 : COPY --from=WLS_BUILD --chown=oracle:oinstall /u01/oracle /u01/oracle/
---> 5d2baca72e9a
Step 47/50 : COPY --from=WDT_BUILD --chown=oracle:oinstall /u01/oracle/Middleware/domains/asr_domain /u01/oracle/Middleware/domains/asr_domain/
---> 2a9093e367fb
Step 48/50 : EXPOSE $ADMIN_PORT $MANAGED_SERVER_PORT
---> Running in 9d083a346bf2
Removing intermediate container 9d083a346bf2
---> d4120c0adae7
Step 49/50 : USER oracle
---> Running in fbbeb75aaa49
Removing intermediate container fbbeb75aaa49
---> 3461a2892fe3
Step 50/50 : WORKDIR /u01/oracle/Middleware/domains/asr_domain
---> Running in a97811fa2dac
Removing intermediate container a97811fa2dac
---> d52f69db54b7
Successfully built d52f69db54b7
Successfully tagged wls:12.2.1.3.0
[oracle@ebsasserter bin]$
[oracle@ebsasserter bin]$
[oracle@ebsasserter bin]$
[oracle@ebsasserter bin]$
[oracle@ebsasserter bin]$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
wls 12.2.1.3.0 d52f69db54b7 2 minutes ago 1.57GB
oraclelinux 7-slim 0d49b70bc432 4 weeks ago 118MB
[oracle@ebsasserter bin]$

docker run -d --name ebsasserter --hostname ebsasserter -v /u01/oracle/properties/domain.properties:/u01/oracle/properties -p 7001:7001 wls:12.2.1.3.0

when i run above command , Nothing happens , it is immediately getting exited ..
how to debug ?

image tool domain creation with WDT tool failing -->/u01/domains/base_domain is not a directory>

Step 35/49 : COPY --chown=oracle:oinstall domain.properties /u01/wdt/models/
---> d6051a5eba89
Step 36/49 : RUN unzip -q /tmp/imagetool/$WDT_PKG -d /u01/wdt && cd /u01/wdt/weblogic-deploy/bin && ./createDomain.sh -oracle_home /u01/oracle -domain_home /u01/domains/base_domain -domain_type WLS -variable_file /u01/wdt/models/domain.properties -model_file /u01/wdt/models/sample.yaml -archive_file /u01/wdt/models/archive.zip
---> Running in d32f0e584d30
JDK version is 1.8.0_211-b12
JAVA_HOME = /u01/jdk
WLST_EXT_CLASSPATH = /u01/wdt/weblogic-deploy/lib/weblogic-deploy-core.jar
CLASSPATH =
WLST_PROPERTIES = -Djava.util.logging.config.class=oracle.weblogic.deploy.logging.WLSDeployLoggingConfig -Dcom.oracle.cie.script.throwException=true -Djava.security.egd=file:/dev/./urandom
/u01/oracle/oracle_common/common/bin/wlst.sh /u01/wdt/weblogic-deploy/lib/python/create.py -oracle_home /u01/oracle -domain_home /u01/domains/base_domain -domain_type WLS -variable_file /u01/wdt/models/domain.properties -model_file /u01/wdt/models/sample.yaml -archive_file /u01/wdt/models/archive.zip
The createDomain program will write its log to /u01/wdt/weblogic-deploy/logs/createDomain.log

Initializing WebLogic Scripting Tool (WLST) ...

Jython scans all the jar files it can find at first startup. Depending on the system, this process may take a few minutes to complete, and WLST may not return a prompt right away.

Welcome to WebLogic Server Administration Scripting Shell

Type help() for help on available commands

####<Dec 28, 2019 4:06:36 PM>

<createDomain argument processing failed: Supplied Domain Home directory /u01/domains/base_domain was not valid: Directory /u01/domains/base_domain is not a directory>

createDomain.sh failed due to a parameter validation error
Removing intermediate container d32f0e584d30
[SEVERE ] Response code: -1, message: docker command failed with error: The command '/bin/sh -c unzip -q /tmp/imagetool/$WDT_PKG -d /u01/wdt && cd /u01/wdt/weblogic-deploy/bin && ./createDomain.sh -oracle_home /u01/oracle -domain_home /u01/domains/base_domain -domain_type WLS -variable_file /u01/wdt/models/domain.properties -model_file /u01/wdt/models/sample.yaml -archive_file /u01/wdt/models/archive.zip' returned a non-zero code: 98

XML External Entity Injection

DocumentBuilderFactory dbfac = DocumentBuilderFactory.newInstance();
DocumentBuilder docBuilder = dbfac.newDocumentBuilder();
InputSource is = new InputSource(new StringReader(xmlString));
Document doc = docBuilder.parse(is);

DocumentBuilderFactory dbfac = DocumentBuilderFactory.newInstance();
DocumentBuilder docBuilder = dbfac.newDocumentBuilder();
InputSource is = new InputSource(new StringReader(xmlString));
Document doc = docBuilder.parse(is);

Using XML parsers configured to not prevent nor limit external entities resolution can expose the parser to an XML External Entities attack

Customizable response file for middleware install

All the user to provide a custom response file for the middleware install step. Currently, the middleware response file is fixed and internal. Since the installer can be customized and its responses could vary, allow the user to override the default response file.

Allow domain re-base

Take an existing image with a domain, and update the JDK or Oracle Home without changing the domain. Recreating the domain will change the passwords and encryption of the configuration which makes it difficult to do rolling restarts with new images.
We need to be able to harvest the domain from an existing image, and create a new image with that same domain.

Recreate WLS environment in image

Using WebLogic Server version information, create a Docker image with the exact patches and WLS version. "weblogic.version -verbose". This could be helpful for taking a production environment into test in order to try to recreate issues.

add hook to insert commands in the Dockerfile

in our case we need to add a RUN command in the Dockerfile to remove the simplefan.jar because this causes an error when the Weblogic Deploy Tool is executed. The cause here is because we are using Oracle Database as a Service and the Weblogic Deploy Tool throws an error because it thinks it deploys on a RAC

<WLSDPLY-20008> <validateModel argument processing failed: validateModel does not recognize argument -method>

####<Dec 28, 2019 4:41:32 PM>

<validateModel argument processing failed: validateModel does not recognize argument -method>

Usage: validateModel.sh [-help]
-oracle_home
[-print_usage [-attributes_only|-folders_only|-recursive] ]
[-model_file ]
[-variable_file ]
[-archive_file ]
[-target_version ]
[-target_mode ]
[-domain_type ]
[-wlst_path ]

where:
    oracle-home     - the existing Oracle Home directory for the domain

    context         - specify the context for printing out the model structure.
                      By default, the specified folder attributes and subfolder
                      names are printed.  Use one of the optional control
                      switches to customize the behavior.  Note that the
                      control switches are mutually exclusive.

    model-file      - the location of the model file to use if not using
                      the -print_usage functionality.  If not specified,
                      the tool will look for the model in the archive.
                      If the model is not found, validation will only
                      validate the artifacts provided.

    variable-file   - the location of the property file containing
                      the variable values for all variables used in
                      the model if not using the -print_usage functionality.
                      If the variable file is not provided, validation will
                      only validate the artifacts provided.

    archive-file    - the path to the archive file to use if not using the
                      -print_usage functionality.  If the archive file is
                      not provided, validation will only validate the
                      artifacts provided.

    target-version  - the target version of WebLogic Server the tool
                      should use to validate the model content.  This
                      version number can be different than the version
                      being used to run the tool.  If not specified, the
                      tool will validate against the version being used
                      to run the tool.

    target-mode     - the target WLST mode that the tool should use to
                      validate the model content.  The only valid values
                      are online or offline.  If not specified, the tool
                      defaults to WLST offline mode.

    domain-type     - the type of domain (e.g., WLS, JRF).
                      Used to locate wlst.cmd if wlst-path not specified

    wlst-path       - the Oracle Home subdirectory of the wlst.cmd
                      script to use (e.g., ^<ORACLE_HOME^>/soa)

validateModel.sh failed due to the usage error shown above
Removing intermediate container 67d6d7810a2a
[SEVERE ] Response code: -1, message: docker command failed with error: The command '/bin/sh -c unzip -q /tmp/imagetool/$WDT_PKG -d /u01/wdt && cd /u01/wdt/weblogic-deploy/bin && chmod u+x ./*.sh && ./validateModel.sh -method lax -oracle_home /u01/oracle -domain_type WLS -variable_file /u01/wdt/models/domain.properties -model_file /u01/wdt/models/sample.yaml -archive_file /u01/wdt/models/archive.zip' returned a non-zero code: 99

'imagetool cache addPatch' is not able to find some patches on Oracle Support

I'm using the tool imagetool cache addPatch to prepare patches for WebLogic Server, but the tool is able to add only some of them.

For example, it works correctly for adding the latest PSU for WLS. Here is the full command that I run to achieve that:

$ imagetool cache addPatch \
    --type wls \
    --version 12.2.1.3.0 \
    --patchId p29016089 \
    --path "${CACHE_DIR}/p29016089_122130_Generic.zip" \
    --user ${ORACLE_SUPPORT_USER} \
    --password ${ORACLE_SUPPORT_PASSWORD}
[2019-06-14 15:53:35] [com.oracle.weblogic.imagetool.cli.cache.AddPatchEntry] [INFO   ] Added Patch entry 29016089_12.2.1.3.0=/tmp/weblogic-image-tool-cache/p29016089_122130_Generic.zip for wls

But then I try to add some patches like the latest OPatch or the patch 26045997 for example, and the command fails indicating that it was not found in Oracle Support. The full command for adding the patch 26045997 and its output is the following:

$ imagetool cache addPatch \
    --type wls \
    --version 12.2.1.3.0 \
    --patchId p26045997 \
    --path "${CACHE_DIR}/p26045997_122130_Generic.zip" \
    --user ${ORACLE_SUPPORT_USER} \
    --password ${ORACLE_SUPPORT_PASSWORD}
[2019-06-14 16:06:10] [com.oracle.weblogic.imagetool.cli.CLIDriver] [SEVERE ] Response code: -1, message: Unable to find patchId p26045997 on Oracle Support

typo in quickstart.md

  1. in the second command to "Use the Cache Tool to add the installers:"
    imagetool cache addInstaller --type wls --version 12.2.1.3.0 --path /home/acmeuser/wls-installers/fmw_12.2.1.3.0_wls_Disk1_1of1.zip
    .tar.gz
    '.tar.gz' needs to be deleted

  2. in the section "Creating an image with no Internet access", in the command:
    imagetool cache addPatch --patchId p27342434 --version 12.2.1.3.0 --path /home/acmeuser/cache/p27342434_122130_Generic .zip -user [email protected] --passwordEnv MYPWD

There should be no space in "p27342434_122130_Generic .zip"
"-user" should be "--user"

  1. in the section "Patching an existing image", in the command:
    imagetool update --fromImage wls:12.2.1.3.0 --tag wls:12.2.1.3.4 --patches 27342434 --version 12.2.1.3.0 --useCache always
    There is no options for '--version' in 'imagetool update' command. We need to remove that.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.