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
This commit is contained in:
George Kalpakas
2022-05-05 18:52:03 +03:00
committed by Andrew Kushnir
parent 0244cf771e
commit b7be9e424b
@@ -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."
)