This works as long as the command is given in the shell. But as soon as it is executed in cron or systemsd.timer (tried both), the is not found.
If I execute instead a “docker ps”, the output shows an empty list (heading is available, but no single container). But there are currently more than 10 containers running.
Looks like you have your containers set up for rootless access, but your service is calling docker as root. You have to run the service as the same user as is running the containers.
docker rootless, timer with unitConfig.ConditionUser = my_user
docker rootless, executed service with serviceConfig.User = my_user
Checked which user is taken for task dockerd, the user of the created file, all these changed with the changes above, but still the command docker ps shows an empty list when executed by the timer.