Repository navigation
Is there a way to automatically run docker system prune -af after a workflow completes #6116
Replies: 2 comments 1 reply
|
I would be a little careful with If you still want that behavior, the simplest approach is probably to wrap #!/usr/bin/env bash
set -e
act "$@"
docker system prune -afor, if you want cleanup even when the workflow fails: #!/usr/bin/env bash
set +e
act "$@"
status=$?
docker system prune -af
exit $statusThat said, I think a safer built-in feature would be an Something like this would be much safer than a global prune: docker image prune -af --filter "label=act"
docker container prune -f --filter "label=act"
docker network prune -f --filter "label=act"assuming So today I would use a wrapper script if you really want automatic cleanup, but I would avoid recommending |
|
Thanks for the info. I will update my process. |
Uh oh!
There was an error while loading. Please reload this page.
When I run a workflow with Nektos Act, it creates a bunch of docker images. After the workflow completes, I can either manually delete these images using Docker Desktop or run
docker system prune -af. Is there a way I can rundocker system prune -afafter the workflow completes or delete the images created in the workflow run some other automated way?All reactions