From c9200fb2c60f840605f84dabda36593db8cd565c Mon Sep 17 00:00:00 2001 From: Derek Sharpe Date: Fri, 9 Dec 2022 10:49:15 -0600 Subject: [PATCH 1/5] Install libnsl to all middleware images to support ADR and FMW Control --- .../main/resources/docker-files/package-managers.mustache | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/imagetool/src/main/resources/docker-files/package-managers.mustache b/imagetool/src/main/resources/docker-files/package-managers.mustache index c717af44..d7e812d4 100644 --- a/imagetool/src/main/resources/docker-files/package-managers.mustache +++ b/imagetool/src/main/resources/docker-files/package-managers.mustache @@ -6,25 +6,25 @@ # Ensure necessary OS packages are installed {{#useYum}} RUN yum -y update \ - && yum -y --downloaddir={{{tempDir}}} install gzip tar unzip libaio jq findutils diffutils {{#osPackages}}{{{.}}} {{/osPackages}}\ + && yum -y --downloaddir={{{tempDir}}} install gzip tar unzip libaio libnsl jq findutils diffutils {{#osPackages}}{{{.}}} {{/osPackages}}\ && yum -y --downloaddir={{{tempDir}}} clean all \ && rm -rf /var/cache/yum/* \ && rm -rf {{{tempDir}}} {{/useYum}} {{#useDnf}} RUN dnf -y update \ - && dnf -y install gzip tar unzip libaio jq findutils diffutils {{#osPackages}}{{{.}}} {{/osPackages}}\ + && dnf -y install gzip tar unzip libaio libnsl jq findutils diffutils {{#osPackages}}{{{.}}} {{/osPackages}}\ && dnf clean all {{/useDnf}} {{#useMicroDnf}} RUN microdnf update \ - && microdnf install gzip tar unzip libaio jq findutils diffutils shadow-utils {{#osPackages}}{{{.}}} {{/osPackages}}\ + && microdnf install gzip tar unzip libaio libnsl jq findutils diffutils shadow-utils {{#osPackages}}{{{.}}} {{/osPackages}}\ && microdnf clean all {{/useMicroDnf}} {{#useAptGet}} RUN apt-get -y update \ && apt-get -y upgrade \ - && apt-get -y install gzip tar unzip libaio jq findutils diffutils {{#osPackages}}{{{.}}} {{/osPackages}}\ + && apt-get -y install gzip tar unzip libaio libnsl jq findutils diffutils {{#osPackages}}{{{.}}} {{/osPackages}}\ && apt-get -y clean all {{/useAptGet}} {{#useApk}} From 50b8454c0078884c0010248f99e9f65d13c38193 Mon Sep 17 00:00:00 2001 From: Derek Sharpe Date: Fri, 9 Dec 2022 10:50:20 -0600 Subject: [PATCH 2/5] Set LD_LIBRARY_PATH in newly created images to include ADR libraries --- .../src/main/resources/docker-files/Create_Image.mustache | 4 ++-- .../src/main/resources/docker-files/Rebase_Image.mustache | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/imagetool/src/main/resources/docker-files/Create_Image.mustache b/imagetool/src/main/resources/docker-files/Create_Image.mustache index 08625ca4..e1aae934 100644 --- a/imagetool/src/main/resources/docker-files/Create_Image.mustache +++ b/imagetool/src/main/resources/docker-files/Create_Image.mustache @@ -31,6 +31,7 @@ USER root FROM os_update as final_build ENV ORACLE_HOME={{{oracle_home}}} \ + LD_LIBRARY_PATH={{{oracle_home}}}/oracle_common/adr:$LD_LIBRARY_PATH \ {{#installJava}} JAVA_HOME={{{java_home}}} \ {{/installJava}} @@ -40,9 +41,8 @@ ENV ORACLE_HOME={{{oracle_home}}} \ {{#modelOnly}} WDT_MODEL_HOME={{{wdt_model_home}}} \ {{/modelOnly}} - {{/isWdtEnabled}} - PATH=${PATH}:{{{java_home}}}/bin:{{{oracle_home}}}/oracle_common/common/bin:{{{oracle_home}}}/wlserver/common/bin:{{{oracle_home}}}{{#isWdtEnabled}}:{{{domain_home}}}/bin {{/isWdtEnabled}} + PATH=${PATH}:{{{java_home}}}/bin:{{{oracle_home}}}/oracle_common/common/bin:{{{oracle_home}}}/wlserver/common/bin:{{{oracle_home}}}{{#isWdtEnabled}}:{{{domain_home}}}/bin{{/isWdtEnabled}} LABEL com.oracle.weblogic.imagetool.buildid="{{buildId}}" diff --git a/imagetool/src/main/resources/docker-files/Rebase_Image.mustache b/imagetool/src/main/resources/docker-files/Rebase_Image.mustache index bf77b695..84af9808 100644 --- a/imagetool/src/main/resources/docker-files/Rebase_Image.mustache +++ b/imagetool/src/main/resources/docker-files/Rebase_Image.mustache @@ -40,10 +40,11 @@ LABEL com.oracle.weblogic.imagetool.buildid="{{buildId}}" FROM os_update as final_build ENV ORACLE_HOME={{{oracle_home}}} \ + LD_LIBRARY_PATH={{{oracle_home}}}/oracle_common/adr:$LD_LIBRARY_PATH \ {{#installJava}} JAVA_HOME={{{java_home}}} \ {{/installJava}} - PATH=${PATH}:{{{java_home}}}/bin:{{{oracle_home}}}/oracle_common/common/bin:{{{oracle_home}}}/wlserver/common/bin:{{{oracle_home}}} + PATH=${PATH}:{{{java_home}}}/bin:{{{oracle_home}}}/oracle_common/common/bin:{{{oracle_home}}}/wlserver/common/bin:{{{oracle_home}}} LABEL com.oracle.weblogic.imagetool.buildid="{{buildId}}" From 949c9585360030dcf1a8e88010965660616dabe7 Mon Sep 17 00:00:00 2001 From: Derek Sharpe Date: Fri, 9 Dec 2022 13:59:39 -0600 Subject: [PATCH 3/5] added Javadoc per static code review --- .../oracle/weblogic/imagetool/cli/menu/CommonOptions.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/imagetool/src/main/java/com/oracle/weblogic/imagetool/cli/menu/CommonOptions.java b/imagetool/src/main/java/com/oracle/weblogic/imagetool/cli/menu/CommonOptions.java index 7210ce10..442e5042 100644 --- a/imagetool/src/main/java/com/oracle/weblogic/imagetool/cli/menu/CommonOptions.java +++ b/imagetool/src/main/java/com/oracle/weblogic/imagetool/cli/menu/CommonOptions.java @@ -156,6 +156,13 @@ void setBuildDirectory(String value) { buildDirectory = value; } + /** + * Apply command line values associated with CommonOptions to Dockerfile options. + * @throws IOException thrown if WIT version cannot be retrieved, or Proxy URLs cannot be read, or + * provided additional build commands file cannot be read. + * @throws InvalidCredentialException Overriding classes may throw this exception + * @throws InvalidPatchIdFormatException Overriding classes may throw this exception + */ void initializeOptions() throws InvalidCredentialException, IOException, InvalidPatchIdFormatException { logger.entering(); buildId = UUID.randomUUID().toString(); From 0d16d815bb22932574b91fceae644ef2ce997d0c Mon Sep 17 00:00:00 2001 From: Derek Sharpe Date: Fri, 9 Dec 2022 14:10:20 -0600 Subject: [PATCH 4/5] fixed Javadoc typo --- .../com/oracle/weblogic/imagetool/cli/menu/CommonOptions.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/imagetool/src/main/java/com/oracle/weblogic/imagetool/cli/menu/CommonOptions.java b/imagetool/src/main/java/com/oracle/weblogic/imagetool/cli/menu/CommonOptions.java index 442e5042..bf65dc53 100644 --- a/imagetool/src/main/java/com/oracle/weblogic/imagetool/cli/menu/CommonOptions.java +++ b/imagetool/src/main/java/com/oracle/weblogic/imagetool/cli/menu/CommonOptions.java @@ -150,7 +150,7 @@ String buildDir() throws IOException { /** * Override the default behavior for generating a temp directory. * This method is used by UNIT tests ONLY. - * @param value should be the value of a temp directory generated by the the UNIT test framework + * @param value should be the value of a temp directory generated by the UNIT test framework */ void setBuildDirectory(String value) { buildDirectory = value; @@ -159,7 +159,7 @@ void setBuildDirectory(String value) { /** * Apply command line values associated with CommonOptions to Dockerfile options. * @throws IOException thrown if WIT version cannot be retrieved, or Proxy URLs cannot be read, or - * provided additional build commands file cannot be read. + * provided additional build commands file cannot be read. * @throws InvalidCredentialException Overriding classes may throw this exception * @throws InvalidPatchIdFormatException Overriding classes may throw this exception */ From 6322c81f6970ede4ccc485ff631d9de0945e77cb Mon Sep 17 00:00:00 2001 From: Derek Sharpe Date: Fri, 9 Dec 2022 14:30:39 -0600 Subject: [PATCH 5/5] static code cleanup in REGEX, removed unnecessary ? --- .../com/oracle/weblogic/imagetool/logging/FileFormatter.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imagetool/src/main/java/com/oracle/weblogic/imagetool/logging/FileFormatter.java b/imagetool/src/main/java/com/oracle/weblogic/imagetool/logging/FileFormatter.java index ee459abe..5ab4176e 100644 --- a/imagetool/src/main/java/com/oracle/weblogic/imagetool/logging/FileFormatter.java +++ b/imagetool/src/main/java/com/oracle/weblogic/imagetool/logging/FileFormatter.java @@ -16,7 +16,7 @@ * This class is a simple log formatting class designed to include the ResourceBundle's MessageKey in the log. */ public class FileFormatter extends Formatter { - private static final String CATALOG_KEY_PATTERN_STRING = "^[A-Z]{3,10}?-[0-9]{3,5}?$"; + private static final String CATALOG_KEY_PATTERN_STRING = "^[A-Z]{3,10}-[0-9]{3,5}$"; private static final Pattern CATALOG_KEY_PATTERN = Pattern.compile(CATALOG_KEY_PATTERN_STRING); private static final String DATE_FORMAT_STRING = "####<{0,date,yyyy.MM.dd} {0,time,HH:mm:ss}>";