Skip to content

Commit 1a701a8

Browse files
xiancaoddsharpe
authored andcommitted
clean up db container (#98)
* clean up db container * remove the db volume when cleanup * clean up db container
1 parent 2d3b64e commit 1a701a8

File tree

1 file changed

+4
-5
lines changed
  • imagetool/src/test/java/com/oracle/weblogic/imagetool/integration

1 file changed

+4
-5
lines changed

imagetool/src/test/java/com/oracle/weblogic/imagetool/integration/BaseTest.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,13 +94,11 @@ protected static void cleanup() throws Exception {
9494
command = "mkdir " + wlsImgCacheDir;
9595
executeNoVerify(command);
9696

97-
// clean up the docker images
98-
command = "docker stop " + dbContainerName;
97+
// clean up the db container
98+
command = "docker rm -f -v " + dbContainerName;
9999
executeNoVerify(command);
100-
// command = "docker rmi -f " + BASE_OS_IMG + ":" + BASE_OS_IMG_TAG + " " + ORACLE_DB_IMG + ":"
101-
// + ORACLE_DB_IMG_TAG;
102-
// executeNoVerify(command);
103100

101+
// clean up the images created in the tests
104102
command = "docker rmi -f $(docker images | grep " + build_tag + " | tr -s ' ' | cut -d ' ' -f 3)";
105103
executeNoVerify(command);
106104

@@ -269,6 +267,7 @@ protected void createDBContainer() throws Exception {
269267
command = "docker run -d --name " + dbContainerName + " --env=\"DB_PDB=InfraPDB1\""
270268
+ " --env=\"DB_DOMAIN=us.oracle.com\" --env=\"DB_BUNDLE=basic\" " + ORACLE_DB_IMG + ":"
271269
+ ORACLE_DB_IMG_TAG;
270+
logger.info("executing command: " + command);
272271
ExecCommand.exec(command);
273272

274273
// wait for the db is ready

0 commit comments

Comments
 (0)