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 коммит произвёл GitHub
Родитель 8170432fab
Коммит 7614564ca5
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 4 добавлений и 2 удалений

Просмотреть файл

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