Merge bitcoin/bitcoin#27777: ci: Prune dangling images on RESTART_CI_DOCKER_BEFORE_RUN

fa123077bc3f39aa0969d883e2d799a054cd4543 ci: Use podman for persistent workers (MarcoFalke)
fa9c65a74cf18e9c75cd3472112d5197532ac2f2 ci: Prune dangling images on RESTART_CI_DOCKER_BEFORE_RUN (MarcoFalke)

Pull request description:

  This should prevent the persistent workers from running out of disk space. Containers are already removed, but not images. This is required since CI images are built and cached.

ACKs for top commit:
  hebasto:
    ACK fa123077bc3f39aa0969d883e2d799a054cd4543

Tree-SHA512: 07c4faec57d659d1762e4e6d776c882ee48d4bac6ce6d438d56d9ab13277be3e39d6aa38816165a5a3e0938ac5d47674ee2921b6e115a4bb54e3e4910b34c4b6
This commit is contained in:
fanquake 2023-05-31 09:35:28 +01:00
commit 08722f20c2
No known key found for this signature in database
GPG Key ID: 2EEB9F5CC09526C1

View File

@ -42,7 +42,9 @@ if [ -z "$DANGER_RUN_CI_ON_HOST" ]; then
if [ -n "${RESTART_CI_DOCKER_BEFORE_RUN}" ] ; then
echo "Restart docker before run to stop and clear all containers started with --rm"
systemctl restart docker
podman container kill --all # Similar to "systemctl restart docker"
echo "Prune all dangling images"
docker image prune --force
fi
# shellcheck disable=SC2086