From b7be9e424b0a2280bf03ce181df7f689df58c5f0 Mon Sep 17 00:00:00 2001 From: George Kalpakas Date: Thu, 5 May 2022 18:52:03 +0300 Subject: [PATCH] build(docs-infra): remove unused Docker artifacts when updating the preview server (#45895) Update the `update-preview-server.sh` script that is used to update the PR preview server to also remove unused Docker images and containers after the update. This avoids having unused Docker artifacts grow uncontrolled and fill up the VM disk drive. PR Close #45895 --- aio/aio-builds-setup/scripts/update-preview-server.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aio/aio-builds-setup/scripts/update-preview-server.sh b/aio/aio-builds-setup/scripts/update-preview-server.sh index efe4c0d9c4e..711ae62a14f 100755 --- a/aio/aio-builds-setup/scripts/update-preview-server.sh +++ b/aio/aio-builds-setup/scripts/update-preview-server.sh @@ -67,5 +67,9 @@ readonly CONTAINER_NAME=aio --volume $HOST_LOGS_DIR:/var/log/aio \ "$LATEST_IMAGE_NAME" + # Clean up unused docker containers and images (to reclaim space). + sudo docker container prune --force + sudo docker image prune --all --force + echo "The new docker image has been successfully deployed." )