[Buildkite] Clean Docker environment on exit (#734)
parent
298d56dea3
commit
7eddf07155
|
@ -5,7 +5,7 @@ set +u
|
||||||
if [[ $BUILDKITE_LABEL =~ ":selenium:" ]] || [[ $BUILDKITE_LABEL =~ ":docker: Build Image" ]]; then
|
if [[ $BUILDKITE_LABEL =~ ":selenium:" ]] || [[ $BUILDKITE_LABEL =~ ":docker: Build Image" ]]; then
|
||||||
CONTAINERS=$(docker ps -a -q)
|
CONTAINERS=$(docker ps -a -q)
|
||||||
if [[ ${CONTAINERS} != "" ]]; then
|
if [[ ${CONTAINERS} != "" ]]; then
|
||||||
echo "--- :docker: Clean environment"
|
echo "--- :docker: Remove lingering containers"
|
||||||
docker rm -f ${CONTAINERS}
|
docker rm -f ${CONTAINERS}
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set +u
|
||||||
|
|
||||||
|
echo "--- :docker: Clean environment"
|
||||||
|
docker system prune -af --volumes
|
Loading…
Reference in New Issue