fix: docker prune volumes

This commit is contained in:
Daniel Langbein 2023-10-16 15:13:12 +02:00
parent 07f4d2d553
commit 1271ce3c61
Signed by: langfingaz
GPG Key ID: 6C47C753F0823002

View File

@ -28,6 +28,7 @@
# };
# Run `docker system prune -f ${autoPrune.flags}` every week.
# This creates `docker-prune.service` and `docker-prune.timer`.
autoPrune.enable = true;
autoPrune.dates = "weekly";
# https://docs.docker.com/engine/reference/commandline/system_prune/#options
@ -54,9 +55,17 @@
script = ''
${pkgs.docker}/bin/docker system prune -f --all --volumes
'';
# Run weekly after `docker-prune.service` has finished.
# Reason: Only one `docker system prune` command can be run at a time.
startAt = "weekly";
after = [ "docker.service" ];
# Start the specified units when this unit is started,
# and stop this unit when the specified units are stopped or fail.
requires = [ "docker.service" ];
# If the specified units are started at the same time as this unit,
# delay this unit until they have started.
after = [ "docker.service" "docker-prune.service" ];
};
# Monitor unhealthy Docker containers.