Skip to content

Commit 638c9e1

Browse files
authored
fix inventory location handling for Rebase (#152)
1 parent 97e03bd commit 638c9e1

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed

imagetool/src/main/java/com/oracle/weblogic/imagetool/util/Utils.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -705,12 +705,13 @@ public static void setInventoryLocation(String inventoryLocFile, DockerfileOptio
705705
BufferedReader reader = new BufferedReader(new FileReader(inventoryLoc.toFile()));
706706
String line;
707707
while ((line = reader.readLine()) != null) {
708-
logger.finest("Read inventory loc file line: {0}", line);
708+
logger.finer("Read inventory loc file line: {0}", line);
709709

710710
matcher.reset(line);
711711
if (matcher.find()) {
712712
String invLoc = matcher.group(1);
713713
if (invLoc != null) {
714+
logger.fine("inventory location file specified new inventory location: {0}", invLoc);
714715
options.setOraInvDir(invLoc);
715716
}
716717
break;

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

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,8 @@ ARG MANAGED_SERVER_PORT
1414
ENV ADMIN_PORT=${ADMIN_PORT} \
1515
MANAGED_SERVER_PORT=${MANAGED_SERVER_PORT}
1616
LABEL com.oracle.weblogic.imagetool.buildid="{{buildId}}"
17-
USER {{userid}}
18-
RUN mkdir -p {{domain_home}}
19-
COPY --from=SOURCE_IMAGE --chown={{userid}}:{{groupid}} {{domain_home}} {{domain_home}}/
20-
2117

2218
{{/isRebaseToTarget}}
23-
24-
2519
{{#isRebaseToNew}}
2620
FROM {{sourceImage}} as SOURCE_IMAGE
2721
FROM {{baseImage}} as OS_UPDATE
@@ -99,6 +93,8 @@ COPY --from=SOURCE_IMAGE --chown={{userid}}:{{groupid}} {{domain_home}} {{domain
9993
&& mkdir -p {{inv_loc}} \
10094
&& chown {{userid}}:{{groupid}} {{inv_loc}} \
10195
{{/isCustomInventoryLoc}}
96+
&& mkdir -p {{orainv_dir}} \
97+
&& chown {{userid}}:{{groupid}} {{orainv_dir}} \
10298
&& chown {{userid}}:{{groupid}} {{{oracle_home}}}
10399

104100
{{#installJava}}
@@ -164,13 +160,18 @@ COPY --from=SOURCE_IMAGE --chown={{userid}}:{{groupid}} {{domain_home}} {{domain
164160
{{/installJava}}
165161

166162
COPY --from=WLS_BUILD --chown={{userid}}:{{groupid}} {{{oracle_home}}} {{{oracle_home}}}/
167-
168-
USER {{userid}}
169-
RUN mkdir -p {{domain_home}}
170-
COPY --from=SOURCE_IMAGE --chown={{userid}}:{{groupid}} {{domain_home}} {{domain_home}}/
171-
163+
{{#copyOraInst}}
164+
COPY --from=WLS_BUILD --chown={{userid}}:{{groupid}} {{inv_loc}}/oraInst.loc {{inv_loc}}/oraInst.loc
165+
{{/copyOraInst}}
166+
{{#copyOraInventoryDir}}
167+
COPY --from=WLS_BUILD --chown={{userid}}:{{groupid}} {{orainv_dir}} {{orainv_dir}}/
168+
{{/copyOraInventoryDir}}
172169
{{/isRebaseToNew}}
173170

171+
USER {{userid}}
172+
RUN mkdir -p {{domain_home}}
173+
COPY --from=SOURCE_IMAGE --chown={{userid}}:{{groupid}} {{domain_home}} {{domain_home}}/
174+
174175
EXPOSE $ADMIN_PORT $MANAGED_SERVER_PORT
175176
WORKDIR {{{work_dir}}}
176177

0 commit comments

Comments
 (0)