This is an automated email from the ASF dual-hosted git repository.

liuxun pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/gravitino-playground.git


The following commit(s) were added to refs/heads/main by this push:
     new 137f3e3  [#118] Remove hello world after check (#119)
137f3e3 is described below

commit 137f3e36f785d2bb6ccfeaa8d87a2e0e64b187ec
Author: danhuawang <[email protected]>
AuthorDate: Tue Dec 31 09:56:39 2024 +0800

    [#118] Remove hello world after check (#119)
    
    Remain too many hello world exit containers after launch playground.
---
 playground.sh | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/playground.sh b/playground.sh
index 3a267c7..e354729 100755
--- a/playground.sh
+++ b/playground.sh
@@ -28,13 +28,19 @@ playground_dir="$(
 
 testDocker() {
   echo "INFO: Testing Docker environment by running hello-world..."
-  docker run --pull always hello-world >/dev/null 2>&1
+  docker run --pull always hello-world:latest >/dev/null 2>&1
   if [ $? -eq 0 ]; then
     echo "INFO: Docker is working correctly!"
   else
     echo "ERROR: There was an issue running the hello-world container. Please 
check your Docker installation."
     exit 1
   fi
+  for containerId in $(docker ps -a | grep hello-world | awk '{print $1}'); do
+    docker rm $containerId
+  done
+  for imageTag in $(docker images | grep hello-world | awk '{print $2}'); do
+    docker rmi hello-world:$imageTag
+  done
 }
 
 checkCompose() {
@@ -85,7 +91,7 @@ start() {
   else
     docker-compose up --detach
   fi
-       
+
   docker compose logs -f >${playground_dir}/playground-${logSuffix}.log 2>&1 &
   echo "Check log details: ${playground_dir}/playground-${logSuffix}.log"
 }

Reply via email to