How to change NOMAD_TASK_DIR from /local to different a target

Hi, I have a nginx container that uses /local for nginx and I can run this container using docker cli with no issues but when I try to run it via nomad it can’t find the /local/ nginx contents and exits as soon as it starts with file not found error.

[root@VJ logs]# nomad --version
Nomad v1.2.3 (a79efc8422082c4790046c3f5ad92c542592a54f)
[root@VJ logs]# docker --version
Docker version 20.10.7, build f0df350

I tried to change NOMAD_TASK_DIR to bind to different target dir but still it binds to /local following this document at Filesystem | Nomad by HashiCorp
config {
load = “nginx-red.tar”
image = “nginx-red”
mounts = {
type = “volume”
source = “local”
target = “/opt”
readonly = true

2022-01-18T16:35:39.864-0600 [DEBUG] client.driver_mgr.docker: binding directories: driver=docker task_name=nginx binds="string{"/tmp/client/alloc/2ade5e48-2ca2-4bdc-aee9-fe5ec2706c18/alloc:/alloc", “/tmp/client/alloc/2ade5e48-2ca2-4bdc-aee9-fe5ec2706c18/nginx/local:/local”, “/tmp/client/alloc/2ade5e48-2ca2-4bdc-aee9-fe5ec2706c18/nginx/secrets:/secrets”, “/root/dockeroffline/cert:/local/web/nginx/cert”}"

Exit Error: line 11: /local/web/nginx/sbin/nginx: No such file or directory
chmod: cannot access ‘/local/web/nginx/logs/’: No such file or directory

Can anyone let me know how to change this bind to some other target dir so it won’t conflict ?


I tried with type = “bind” as well but result is same and task dir is still mounts on /local.