Skip to content

Commit 1c62a80

Browse files
authored
Try to avoid copy issue with certain version of docker (#220)
1 parent 596a1a7 commit 1c62a80

File tree

3 files changed

+20
-8
lines changed

3 files changed

+20
-8
lines changed

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,14 @@ public String wdt_model_home() {
314314
return wdtModelHome;
315315
}
316316

317+
/**
318+
* Check to see if WDT model home is not under WDT home.
319+
* @return true|false
320+
*/
321+
public boolean isWdtModelHomeOutsideWdtHome() {
322+
return !wdtModelHome.startsWith(wdtHome + File.separator);
323+
}
324+
317325
public boolean isWdtValidateEnabled() {
318326
return isWdtEnabled() && modelOnly() && (!wdtModelList.isEmpty() || !wdtArchiveList.isEmpty());
319327
}

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -247,11 +247,13 @@ COPY --from=WLS_BUILD --chown={{userid}}:{{groupid}} {{{oracle_home}}} {{{oracle
247247
RUN DOMAIN_PARENT=$(dirname {{{domain_home}}}) \
248248
&& mkdir -p $DOMAIN_PARENT \
249249
&& chown {{userid}}:{{groupid}} $DOMAIN_PARENT \
250-
&& chmod g+w $DOMAIN_PARENT
251-
COPY --from=WDT_BUILD --chown={{userid}}:{{groupid}} {{wdt_home}} {{wdt_home}}/
252-
RUN mkdir -p {{{wdt_model_home}}} \
250+
&& chmod g+w $DOMAIN_PARENT \
251+
&& mkdir -p {{{wdt_model_home}}} \
253252
&& chmod g+w {{{wdt_model_home}}}
254-
COPY --from=WDT_BUILD --chown={{userid}}:{{groupid}} {{wdt_model_home}} {{wdt_model_home}}/
253+
COPY --from=WDT_BUILD --chown={{userid}}:{{groupid}} {{wdt_home}} {{wdt_home}}/
254+
{{#isWdtModelHomeOutsideWdtHome}}
255+
COPY --from=WDT_BUILD --chown={{userid}}:{{groupid}} {{wdt_model_home}} {{wdt_model_home}}/
256+
{{/isWdtModelHomeOutsideWdtHome}}
255257
{{/modelOnly}}
256258
{{^modelOnly}}
257259
COPY --from=WDT_BUILD --chown={{userid}}:{{groupid}} {{{domain_home}}} {{{domain_home}}}/

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,11 +120,13 @@ USER {{userid}}
120120
RUN DOMAIN_PARENT=$(dirname {{{domain_home}}}) \
121121
&& mkdir -p $DOMAIN_PARENT \
122122
&& chown {{userid}}:{{groupid}} $DOMAIN_PARENT \
123-
&& chmod g+w $DOMAIN_PARENT
124-
COPY --from=WDT_BUILD --chown={{userid}}:{{groupid}} {{wdt_home}} {{wdt_home}}/
125-
RUN mkdir -p {{{wdt_model_home}}} \
123+
&& chmod g+w $DOMAIN_PARENT \
124+
&& mkdir -p {{{wdt_model_home}}} \
126125
&& chmod g+w {{{wdt_model_home}}}
127-
COPY --from=WDT_BUILD --chown={{userid}}:{{groupid}} {{wdt_model_home}} {{wdt_model_home}}/
126+
COPY --from=WDT_BUILD --chown={{userid}}:{{groupid}} {{wdt_home}} {{wdt_home}}/
127+
{{#isWdtModelHomeOutsideWdtHome}}
128+
COPY --from=WDT_BUILD --chown={{userid}}:{{groupid}} {{wdt_model_home}} {{wdt_model_home}}/
129+
{{/isWdtModelHomeOutsideWdtHome}}
128130
{{/modelOnly}}
129131
{{^modelOnly}}
130132
COPY --from=WDT_BUILD --chown={{userid}}:{{groupid}} {{{domain_home}}} {{{domain_home}}}/

0 commit comments

Comments
 (0)