Make /usr/share/gitlab-runner/clear-docker-cache /bin/sh compatible

parent 82714ae8
......@@ -5,12 +5,12 @@ docker version >/dev/null 2>/dev/null
echo Clearing docker cache...
CONTAINERS=($(docker ps -a \
--filter=status=exited \
--filter=status=dead \
--filter=label=com.gitlab.gitlab-runner.type=cache \
--format='{{.ID}}'))
CONTAINERS=$(docker ps -a \
--filter=status=exited \
--filter=status=dead \
--filter=label=com.gitlab.gitlab-runner.type=cache \
--format='{{.ID}}')
if [[ -n "${CONTAINERS}" ]]; then
docker rm -v ${CONTAINERS[@]}
if [ -n "${CONTAINERS}" ]; then
docker rm -v ${CONTAINERS}
fi
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment