@@ -46,16 +46,16 @@ public abstract class ImageOperation implements Callable<CommandResponse> {
46
46
protected DockerfileOptions dockerfileOptions ;
47
47
protected CacheStore cacheStore = new CacheStoreFactory ().get ();
48
48
private String nonProxyHosts = null ;
49
- boolean isCLIMode ;
49
+ boolean isCliMode ;
50
50
String password ;
51
51
52
52
ImageOperation () {
53
53
dockerfileOptions = new DockerfileOptions ();
54
54
}
55
55
56
- ImageOperation (boolean isCLIMode ) {
56
+ ImageOperation (boolean isCliMode ) {
57
57
this ();
58
- this .isCLIMode = isCLIMode ;
58
+ this .isCliMode = isCliMode ;
59
59
}
60
60
61
61
@ Override
@@ -136,8 +136,6 @@ List<String> handlePatchFiles(String tmpDir, Path tmpPatchesDir) throws Exceptio
136
136
}
137
137
}
138
138
if (!patchLocations .isEmpty ()) {
139
- retVal .add (Constants .BUILD_ARG );
140
- retVal .add ("PATCHDIR=" + Paths .get (tmpDir ).relativize (tmpPatchesDir ).toString ());
141
139
dockerfileOptions .setPatchingEnabled ();
142
140
}
143
141
logger .exiting (retVal .size ());
@@ -193,7 +191,7 @@ public Path createPatchesTempDirectory(String tmpDir) throws IOException {
193
191
return tmpPatchesDir ;
194
192
}
195
193
196
- void handleProxyUrls () throws IOException {
194
+ private void handleProxyUrls () throws IOException {
197
195
httpProxyUrl = Utils .findProxyUrl (httpProxyUrl , Constants .HTTP );
198
196
httpsProxyUrl = Utils .findProxyUrl (httpsProxyUrl , Constants .HTTPS );
199
197
nonProxyHosts = Utils .findProxyUrl (nonProxyHosts , "none" );
@@ -317,9 +315,12 @@ private List<String> getWdtRequiredBuildArgs(Path wdtVariablesPath) throws IOExc
317
315
* @throws IOException in case of error
318
316
*/
319
317
protected List <String > handleWdtArgsIfRequired (String tmpDir ) throws IOException {
320
- logger .finer ("Entering CreateImage.handleWdtArgsIfRequired: " + tmpDir );
318
+ logger .entering (tmpDir );
319
+
321
320
List <String > retVal = new LinkedList <>();
322
321
if (wdtModelPath != null ) {
322
+ dockerfileOptions .setWdtEnabled ();
323
+ dockerfileOptions .setWdtModelOnly (wdtModelOnly );
323
324
String [] modelFiles = wdtModelPath .toString ().split ("," );
324
325
List <String > modelList = new ArrayList <>();
325
326
@@ -335,34 +336,28 @@ protected List<String> handleWdtArgsIfRequired(String tmpDir) throws IOException
335
336
}
336
337
dockerfileOptions .setWdtModels (modelList );
337
338
339
+ dockerfileOptions .setWdtDomainType (wdtDomainType );
338
340
if (wdtDomainType != DomainType .WLS ) {
339
341
if (installerType != WLSInstallerType .FMW ) {
340
342
throw new IOException ("FMW installer is required for JRF domain" );
341
343
}
342
- retVal .add (Constants .BUILD_ARG );
343
- retVal .add ("DOMAIN_TYPE=" + wdtDomainType );
344
344
if (runRcu ) {
345
345
retVal .add (Constants .BUILD_ARG );
346
346
retVal .add ("RCU_RUN_FLAG=" + "-run_rcu" );
347
347
}
348
348
}
349
- dockerfileOptions .setWdtEnabled ();
350
349
351
350
if (wdtArchivePath != null && Files .isRegularFile (wdtArchivePath )) {
352
351
String wdtArchiveFilename = wdtArchivePath .getFileName ().toString ();
353
352
Files .copy (wdtArchivePath , Paths .get (tmpDir , wdtArchiveFilename ));
354
- retVal .add (Constants .BUILD_ARG );
355
- retVal .add ("WDT_ARCHIVE=" + wdtArchiveFilename );
356
- }
357
- if (wdtDomainHome != null ) {
358
- retVal .add (Constants .BUILD_ARG );
359
- retVal .add ("DOMAIN_HOME=" + wdtDomainHome );
353
+ //Until WDT supports multiple archives, take single file argument from CLI and convert to list
354
+ List <String > archives = new ArrayList <>();
355
+ archives .add (wdtArchiveFilename );
356
+ dockerfileOptions .setWdtArchives (archives );
360
357
}
358
+ dockerfileOptions .setDomainHome (wdtDomainHome );
361
359
362
- if (wdtJavaOptions != null ) {
363
- retVal .add (Constants .BUILD_ARG );
364
- retVal .add ("WLSDEPLOY_PROPERTIES=" + wdtJavaOptions );
365
- }
360
+ dockerfileOptions .setJavaOptions (wdtJavaOptions );
366
361
367
362
if (wdtVariablesPath != null && Files .isRegularFile (wdtVariablesPath )) {
368
363
String wdtVariableFilename = wdtVariablesPath .getFileName ().toString ();
@@ -372,7 +367,7 @@ protected List<String> handleWdtArgsIfRequired(String tmpDir) throws IOException
372
367
retVal .addAll (getWdtRequiredBuildArgs (wdtVariablesPath ));
373
368
}
374
369
}
375
- logger .finer ( "Exiting CreateImage.handleWdtArgsIfRequired: " );
370
+ logger .exiting ( );
376
371
return retVal ;
377
372
}
378
373
@@ -561,6 +556,14 @@ private void addWdtUrl(String wdtKey) throws Exception {
561
556
)
562
557
private String wdtJavaOptions ;
563
558
559
+
560
+ @ Option (
561
+ names = {"--wdtModelOnly" },
562
+ description = "Install WDT and copy the models to the image, but do not create the domain. "
563
+ + "Default: ${DEFAULT-VALUE}."
564
+ )
565
+ private boolean wdtModelOnly = false ;
566
+
564
567
@ Unmatched
565
568
List <String > unmatchedOptions ;
566
569
}
0 commit comments