File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed
src/main/java/com/oracle/weblogicx/imagebuilder Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -68,7 +68,9 @@ public CommandResponse call() throws Exception {
68
68
69
69
List <String > cmdBuilder = getInitialBuildCmd ();
70
70
// create a tmp directory for user.
71
- tmpDir = Files .createTempDirectory (null );
71
+ // using user home as base to avoid running out of space in tmp
72
+ tmpDir = Files .createTempDirectory (Paths .get (System .getProperty ("user.home" )),
73
+ "wlsimgbuilder_temp" );
72
74
String tmpDirPath = tmpDir .toAbsolutePath ().toString ();
73
75
logger .info ("tmp directory used for build context: " + tmpDirPath );
74
76
Path tmpPatchesDir = Files .createDirectory (Paths .get (tmpDirPath , "patches" ));
@@ -80,7 +82,8 @@ public CommandResponse call() throws Exception {
80
82
if (fromImage != null && !fromImage .isEmpty ()) {
81
83
cmdBuilder .add (BUILD_ARG );
82
84
83
- tmpDir2 = Files .createTempDirectory (Paths .get (System .getProperty ("user.home" )), null );
85
+ tmpDir2 = Files .createTempDirectory (Paths .get (System .getProperty ("user.home" )),
86
+ "wlsimgbuilder_temp" );
84
87
logger .info ("tmp directory in user.home for docker run: " + tmpDir2 );
85
88
86
89
Utils .copyResourceAsFile ("/probe-env/test-create-env.sh" ,
Original file line number Diff line number Diff line change @@ -323,6 +323,10 @@ public static void deleteFilesRecursively(Path tmpDir) throws IOException {
323
323
.map (Path ::toFile )
324
324
//.peek(System.out::println)
325
325
.forEach (File ::delete );
326
+
327
+ if (Files .exists (tmpDir )) {
328
+ logger .warning ("Directory not cleaned up, please remove it manually " + tmpDir .toString ());
329
+ }
326
330
}
327
331
}
328
332
You can’t perform that action at this time.
0 commit comments