diff --git a/.buildkite/hooks/pre-exit b/.buildkite/hooks/pre-exit index 6a1767f98..8224e4146 100755 --- a/.buildkite/hooks/pre-exit +++ b/.buildkite/hooks/pre-exit @@ -2,5 +2,7 @@ set +u -echo "--- :docker: Clean environment" -docker system prune -af --volumes \ No newline at end of file +if [[ $BUILDKITE_AGENT_META_DATA_CLEANBUILD != "false" ]]; then + echo "--- :docker: Clean environment" + docker system prune -af --volumes +fi \ No newline at end of file