I'm building some software with
docker-compose, for which I would like to run on a schedule.
So I need to schedule a run of
docker-compose up, on MacOS (High Sierra, 10.13.3), using launchd. This is the LaunchAgent configuration I'm using.
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>Label</key> <string>local.edgarlydata</string> <!-- This script, which calls "docker-compose up" also fails :/ <key>Program</key> <string>/Users/me/my/project/my-script.sh</string> --> <key>ProgramArguments</key> <array> <string>/usr/local/bin/docker-compose</string> <string>up</string> </array> <key>StartCalendarInterval</key> <array> <dict> <key>Hour</key> <integer>19</integer> <key>Minute</key> <integer>18</integer> <key>Weekday</key> <integer>3</integer> </dict> </array> </dict> </plist>
And when the process is launched at the scheduled time, the system log gives me this error message. There's no reason as to why the failure is happening.
Aug 15 19:18:00 MacBook-Pro com.apple.xpc.launchd (local.edgarlydata): Service exited with abnormal code: 1
EDITED to add contents of a try with
/Users/me/my/project/my-script.sh. No dice.
#!/bin/sh sudo -u myuser /usr/local/bin/docker-compose up
I saw a similar question here. But that was for
docker-compose needs to start from a project directory. Needless to say, it doesn't solve the problem.