Skip to content

Commit 55f721a

Browse files
authored
Add libnsl OS package to images in support of ADR and FMW Control (#409)
* Install libnsl to all middleware images to support ADR and FMW Control * Set LD_LIBRARY_PATH in newly created images to include ADR libraries * added Javadoc per static code review * fixed Javadoc typo * static code cleanup in REGEX, removed unnecessary ?
1 parent 5f4dbb0 commit 55f721a

File tree

5 files changed

+17
-9
lines changed

5 files changed

+17
-9
lines changed

imagetool/src/main/java/com/oracle/weblogic/imagetool/cli/menu/CommonOptions.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,12 +150,19 @@ String buildDir() throws IOException {
150150
/**
151151
* Override the default behavior for generating a temp directory.
152152
* This method is used by UNIT tests ONLY.
153-
* @param value should be the value of a temp directory generated by the the UNIT test framework
153+
* @param value should be the value of a temp directory generated by the UNIT test framework
154154
*/
155155
void setBuildDirectory(String value) {
156156
buildDirectory = value;
157157
}
158158

159+
/**
160+
* Apply command line values associated with CommonOptions to Dockerfile options.
161+
* @throws IOException thrown if WIT version cannot be retrieved, or Proxy URLs cannot be read, or
162+
* provided additional build commands file cannot be read.
163+
* @throws InvalidCredentialException Overriding classes may throw this exception
164+
* @throws InvalidPatchIdFormatException Overriding classes may throw this exception
165+
*/
159166
void initializeOptions() throws InvalidCredentialException, IOException, InvalidPatchIdFormatException {
160167
logger.entering();
161168
buildId = UUID.randomUUID().toString();

imagetool/src/main/java/com/oracle/weblogic/imagetool/logging/FileFormatter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* This class is a simple log formatting class designed to include the ResourceBundle's MessageKey in the log.
1717
*/
1818
public class FileFormatter extends Formatter {
19-
private static final String CATALOG_KEY_PATTERN_STRING = "^[A-Z]{3,10}?-[0-9]{3,5}?$";
19+
private static final String CATALOG_KEY_PATTERN_STRING = "^[A-Z]{3,10}-[0-9]{3,5}$";
2020
private static final Pattern CATALOG_KEY_PATTERN = Pattern.compile(CATALOG_KEY_PATTERN_STRING);
2121

2222
private static final String DATE_FORMAT_STRING = "####<{0,date,yyyy.MM.dd} {0,time,HH:mm:ss}>";

imagetool/src/main/resources/docker-files/Create_Image.mustache

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ USER root
3131
FROM os_update as final_build
3232

3333
ENV ORACLE_HOME={{{oracle_home}}} \
34+
LD_LIBRARY_PATH={{{oracle_home}}}/oracle_common/adr:$LD_LIBRARY_PATH \
3435
{{#installJava}}
3536
JAVA_HOME={{{java_home}}} \
3637
{{/installJava}}
@@ -40,9 +41,8 @@ ENV ORACLE_HOME={{{oracle_home}}} \
4041
{{#modelOnly}}
4142
WDT_MODEL_HOME={{{wdt_model_home}}} \
4243
{{/modelOnly}}
43-
{{/isWdtEnabled}}
44-
PATH=${PATH}:{{{java_home}}}/bin:{{{oracle_home}}}/oracle_common/common/bin:{{{oracle_home}}}/wlserver/common/bin:{{{oracle_home}}}{{#isWdtEnabled}}:{{{domain_home}}}/bin
4544
{{/isWdtEnabled}}
45+
PATH=${PATH}:{{{java_home}}}/bin:{{{oracle_home}}}/oracle_common/common/bin:{{{oracle_home}}}/wlserver/common/bin:{{{oracle_home}}}{{#isWdtEnabled}}:{{{domain_home}}}/bin{{/isWdtEnabled}}
4646

4747
LABEL com.oracle.weblogic.imagetool.buildid="{{buildId}}"
4848

imagetool/src/main/resources/docker-files/Rebase_Image.mustache

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,11 @@ LABEL com.oracle.weblogic.imagetool.buildid="{{buildId}}"
4040
FROM os_update as final_build
4141

4242
ENV ORACLE_HOME={{{oracle_home}}} \
43+
LD_LIBRARY_PATH={{{oracle_home}}}/oracle_common/adr:$LD_LIBRARY_PATH \
4344
{{#installJava}}
4445
JAVA_HOME={{{java_home}}} \
4546
{{/installJava}}
46-
PATH=${PATH}:{{{java_home}}}/bin:{{{oracle_home}}}/oracle_common/common/bin:{{{oracle_home}}}/wlserver/common/bin:{{{oracle_home}}}
47+
PATH=${PATH}:{{{java_home}}}/bin:{{{oracle_home}}}/oracle_common/common/bin:{{{oracle_home}}}/wlserver/common/bin:{{{oracle_home}}}
4748

4849
LABEL com.oracle.weblogic.imagetool.buildid="{{buildId}}"
4950

imagetool/src/main/resources/docker-files/package-managers.mustache

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,25 @@
66
# Ensure necessary OS packages are installed
77
{{#useYum}}
88
RUN yum -y update \
9-
&& yum -y --downloaddir={{{tempDir}}} install gzip tar unzip libaio jq findutils diffutils {{#osPackages}}{{{.}}} {{/osPackages}}\
9+
&& yum -y --downloaddir={{{tempDir}}} install gzip tar unzip libaio libnsl jq findutils diffutils {{#osPackages}}{{{.}}} {{/osPackages}}\
1010
&& yum -y --downloaddir={{{tempDir}}} clean all \
1111
&& rm -rf /var/cache/yum/* \
1212
&& rm -rf {{{tempDir}}}
1313
{{/useYum}}
1414
{{#useDnf}}
1515
RUN dnf -y update \
16-
&& dnf -y install gzip tar unzip libaio jq findutils diffutils {{#osPackages}}{{{.}}} {{/osPackages}}\
16+
&& dnf -y install gzip tar unzip libaio libnsl jq findutils diffutils {{#osPackages}}{{{.}}} {{/osPackages}}\
1717
&& dnf clean all
1818
{{/useDnf}}
1919
{{#useMicroDnf}}
2020
RUN microdnf update \
21-
&& microdnf install gzip tar unzip libaio jq findutils diffutils shadow-utils {{#osPackages}}{{{.}}} {{/osPackages}}\
21+
&& microdnf install gzip tar unzip libaio libnsl jq findutils diffutils shadow-utils {{#osPackages}}{{{.}}} {{/osPackages}}\
2222
&& microdnf clean all
2323
{{/useMicroDnf}}
2424
{{#useAptGet}}
2525
RUN apt-get -y update \
2626
&& apt-get -y upgrade \
27-
&& apt-get -y install gzip tar unzip libaio jq findutils diffutils {{#osPackages}}{{{.}}} {{/osPackages}}\
27+
&& apt-get -y install gzip tar unzip libaio libnsl jq findutils diffutils {{#osPackages}}{{{.}}} {{/osPackages}}\
2828
&& apt-get -y clean all
2929
{{/useAptGet}}
3030
{{#useApk}}

0 commit comments

Comments
 (0)