Hi,
I'm trying to run a couple of chained tasks in a Docker container as a Nomad task and have run into some difficulties.
A command that works outside of Nomad:
docker run --rm -it ourtask/image:latest sh -c "task arg1 --arg2 val2 | task arga argb"
The only success I've had is by just running the first task as a command. Relevant portion of job spec:
task "loader" {
driver = "docker"
config {
image = "ourtask/image:latest"
command = "task"
args = [
"arg1",
"--arg2", "val2"
]
}
If I use "sh" as the command with ["task", "arg1", "--arg2", "val2"] as the list of arguments then 'task' gets run but doesn't seem to be receiving the arguments.
The success example does appear to run properly, based on the log output at alloc/log/loader.stderr.0 but the output of the task, which is emitted to stdout, is nowhere to be found.
So there are two main problems:
1. Passing in a command and args so that the entire line is executed. I realize there are other possibilities, e.g. using artifacts to define more complex config options, but we'll be generating a lot of different jobs using the same tasks and it would be most clear if everything were defined in the job specs.
2. Where is the output? It won't matter if I can run the whole line if there's no stdout to redirect to the next one.
Thanks,
Cristina
(Nomad & Docker newbie)