fix: docker-health.service

This commit is contained in:
Daniel Langbein 2024-01-12 19:43:26 +01:00
parent 75ca63f344
commit 536859f642
Signed by: langfingaz
GPG Key ID: 6C47C753F0823002

View File

@ -2,7 +2,7 @@
{ {
# https://nixos.wiki/wiki/Docker#Installation # https://nixos.wiki/wiki/Docker#Installation
# TODO: rootless Docker. https://nixos.wiki/wiki/Docker#Rootless_docker # TODO: rootless Docker equivalent with root privileges? https://nixos.wiki/wiki/Docker#Rootless_docker
# TODO: run as systemd services. https://nixos.wiki/wiki/Docker#docker_containers_as_systemd_services # TODO: run as systemd services. https://nixos.wiki/wiki/Docker#docker_containers_as_systemd_services
virtualisation = { virtualisation = {
@ -100,7 +100,7 @@
# Lastly, we redirect stdout to stderr with `1>&2` so that unhealthy containers are written to stderr. # Lastly, we redirect stdout to stderr with `1>&2` so that unhealthy containers are written to stderr.
script = '' script = ''
set -eu -o pipefail set -eu -o pipefail
! sudo docker ps -f health=unhealthy | grep -v 'CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES' 1>&2 ! docker ps -f health=unhealthy | grep -v 'CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES' 1>&2
''; '';
}; };
} }