Running a command from a mounted hosted volume

Hi,

I’ve noticed that if I mount a host volume (exec task type), let’s say on a path /volume1, and I run a task consisting of a bash -c command that lists the contents of /volume1, I can see all the files on the volume.

However, when I put the “bash” executable in /volume1/bash, and I run a task consisting of a /volume1/bash -c command, nomad fails to run it as it’s only looking for the binary in the chroot environment.

Is there any way to run a task which has an executable on the mounted volume?

Interestingly I’ve found this GH issue that explains the setup a bit more:

For anyone interested:

  • you can setup a PATH env variable in the task and reference the command without an absolute path
  • or you can use bash -c “/volume1/your_command”

Weird workarounds around the nomad exec checker, but both work :slight_smile: