chore: replace docker/cli.sh stop with docker/cli.sh cleanup (#16537)

We have to cleanup images to free space occupied by docker.
This commit is contained in:
Andrey Lushnikov 2022-08-15 01:21:06 -07:00 committed by GitHub
parent 8170432fab
commit 7614564ca5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -6,7 +6,7 @@ set +x
set -o pipefail
if [[ ($1 == '--help') || ($1 == '-h') ]]; then
echo "usage: $(basename "$0") [webkit-ubuntu-20.04|firefox-debian-11|...] [build|test|compile|enter|stop]"
echo "usage: $(basename "$0") [webkit-ubuntu-20.04|firefox-debian-11|...] [build|test|compile|enter|cleanup]"
echo
echo "Builds Webkit or Firefox browser inside given Linux distribution"
exit 0
@ -85,10 +85,12 @@ elif [[ "$2" == "compile" ]]; then
'
elif [[ "$2" == "enter" ]]; then
docker run --rm ${DOCKER_ARGS} --init --name "${DOCKER_CONTAINER_NAME}" --platform "${DOCKER_PLATFORM}" -it "${DOCKER_IMAGE_NAME}" /bin/bash
elif [[ "$2" == "kill" || "$2" == "stop" ]]; then
elif [[ "$2" == "cleanup" ]]; then
docker kill "${DOCKER_CONTAINER_NAME}" || true
# Wait for container to stop
docker wait "${DOCKER_CONTAINER_NAME}" || true
docker rmi "${DOCKER_IMAGE_NAME}"
docker system prune -f
else
echo "ERROR: unknown command - $2"
exit 1