Skip to content

Commit 5ac6b8e

Browse files
authored
fix bug with aux image where no models, archives, or variables are provided. (#324)
1 parent 50f17da commit 5ac6b8e

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,14 @@ public String wdtModelHome() {
4848
* @param tmpDir the tmp directory which is passed to docker as the build context directory
4949
* @throws IOException in case of error
5050
*/
51-
void handleWdtArgs(DockerfileOptions dockerfileOptions, String tmpDir) throws IOException {
51+
public void handleWdtArgs(DockerfileOptions dockerfileOptions, String tmpDir) throws IOException {
5252
logger.entering(tmpDir);
5353

54-
dockerfileOptions.setWdtEnabled()
55-
.setWdtHome(wdtHome)
56-
.setWdtModelHome(wdtModelHome);
54+
if (isWdtModelProvided()) {
55+
dockerfileOptions.setWdtEnabled();
56+
}
57+
58+
dockerfileOptions.setWdtHome(wdtHome).setWdtModelHome(wdtModelHome);
5759

5860
if (wdtModelPath != null) {
5961
List<String> modelList = addWdtFilesAsList(wdtModelPath, "model", tmpDir);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public boolean modelOnly() {
4444
* @throws IOException in case of error
4545
*/
4646
@Override
47-
void handleWdtArgs(DockerfileOptions dockerfileOptions, String tmpDir) throws IOException {
47+
public void handleWdtArgs(DockerfileOptions dockerfileOptions, String tmpDir) throws IOException {
4848
logger.entering(tmpDir);
4949
if (!isUsingWdt()) {
5050
logger.exiting();

imagetool/src/main/resources/docker-files/aux-image.mustache

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,9 @@ COPY --from=wdt_build --chown={{userid}}:{{groupid}} {{wdt_home}} {{wdt_home}}/
5454
COPY --chown={{userid}}:{{groupid}} {{{.}}} {{{wdt_model_home}}}/
5555
{{/wdtVariables}}
5656

57-
RUN chmod -R 640 {{{wdt_model_home}}}/*
57+
{{#isWdtEnabled}}
58+
RUN chmod -R 640 {{{wdt_model_home}}}/*
59+
{{/isWdtEnabled}}
5860

5961
USER {{userid}}
6062

0 commit comments

Comments
 (0)