With the latest Sparrowdo commits it’s now possible to run Sparrowdo tasks on running Docker containers:
Spin up a Docker container:
$ docker pull bitnami/minideb-extras # Debian minimal $ docker run -d instance0 -it minideb-extras bash
Create some Sparrowdo scenario:
$ cat sparrowfile use v6; use Sparrowdo; task-run 'check disk available space', 'df-check', %( threshold => 80 ); bash 'pwd';
Ran Sparrowdo scenario on running Docker container:
$ sparrowdo --docker=instance0 --bootstrap --no_sudo --format=production
Output:
running sparrow tasks on 127.0.0.1 ... target OS is - ubuntu push [task] check disk available space [plg] df-check OK push [task] run bash: pwd ... OK SPL file /opt/sparrow/sparrow.list is empty get index updates from SparrowHub ... OK set up task box file - /home/melezhik/.sparrowdo//opt/sparrow/task-box.json - OK public@df-check is uptodate (0.2.3) public@bash is uptodate (0.1.6) running task box from /opt/sparrow/sparrow-cache/task-box.json ... 2017-09-22 11:12:39 : [task] check disk available space [plg] df-check [path] / threshhold: 80 2017-09-22 11:12:39 : [task] run bash: pwd ... [path] modules/bash-command/ [params] envvars:
Caveats
You should have bash and curl pre installed at your Docker container.
Leave a Reply