mirror of
https://codeberg.org/privacy1st/nix-git
synced 2024-11-21 22:03:19 +01:00
fix: docker prune volumes
This commit is contained in:
parent
07f4d2d553
commit
1271ce3c61
@ -28,6 +28,7 @@
|
|||||||
# };
|
# };
|
||||||
|
|
||||||
# Run `docker system prune -f ${autoPrune.flags}` every week.
|
# Run `docker system prune -f ${autoPrune.flags}` every week.
|
||||||
|
# This creates `docker-prune.service` and `docker-prune.timer`.
|
||||||
autoPrune.enable = true;
|
autoPrune.enable = true;
|
||||||
autoPrune.dates = "weekly";
|
autoPrune.dates = "weekly";
|
||||||
# https://docs.docker.com/engine/reference/commandline/system_prune/#options
|
# https://docs.docker.com/engine/reference/commandline/system_prune/#options
|
||||||
@ -54,9 +55,17 @@
|
|||||||
script = ''
|
script = ''
|
||||||
${pkgs.docker}/bin/docker system prune -f --all --volumes
|
${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";
|
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" ];
|
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.
|
# Monitor unhealthy Docker containers.
|
||||||
|
Loading…
Reference in New Issue
Block a user