diff options
author | Alex Auvolat <alex@adnab.me> | 2022-11-28 18:30:33 +0100 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2022-11-28 18:30:33 +0100 |
commit | 14bd8f2010c3a1f90c6d1297f47ebbf46ee87dde (patch) | |
tree | c3ed1e173f97c8650523afc160e66d0fb41c1d26 /example | |
parent | cbde799457a8470cd64a09d10827577d005ca6f8 (diff) | |
download | nomad-driver-nix2-14bd8f2010c3a1f90c6d1297f47ebbf46ee87dde.tar.gz nomad-driver-nix2-14bd8f2010c3a1f90c6d1297f47ebbf46ee87dde.zip |
Add support for bind mount declared for all jobs
Diffstat (limited to 'example')
-rw-r--r-- | example/agent.hcl | 7 | ||||
-rw-r--r-- | example/example.hcl | 23 |
2 files changed, 25 insertions, 5 deletions
diff --git a/example/agent.hcl b/example/agent.hcl index f25b095..c704243 100644 --- a/example/agent.hcl +++ b/example/agent.hcl @@ -3,5 +3,10 @@ client { } -plugin "exec2" { +plugin "exec2-driver" { + config { + bind_read_only = { + "/etc" = "/etc", + } + } } diff --git a/example/example.hcl b/example/example.hcl index 52b02f6..80da070 100644 --- a/example/example.hcl +++ b/example/example.hcl @@ -3,7 +3,24 @@ job "example" { type = "batch" group "example" { - task "hello-world" { + task "test-host-bin" { + driver = "exec2" + + config { + command = "/bin/sh" + args = ["-c", "echo hello world"] + bind_read_only = { + "/bin" = "/bin", + "/lib" = "/lib", + "/lib64" = "/lib64", + "/usr" = "/usr", + "/nix" = "/nix", + } + } + user = "lx" + } + + task "test-nix-hello" { driver = "exec2" config { @@ -18,21 +35,19 @@ job "example" { "/nix" = "/nix", } bind_read_only = { - "/etc" = "/etc", "/home/lx/.nix-profile" = "/sw", } } user = "lx" } - task "test" { + task "test-nix-store" { driver = "exec2" config { command = "/nix/store/30j23057fqnnc1p4jqmq73p0gxgn0frq-bash-5.1-p16/bin/sh" args = ["-c", "/nix/store/y41s1vcn0irn9ahn9wh62yx2cygs7qjj-coreutils-8.32/bin/ls /*; /nix/store/y41s1vcn0irn9ahn9wh62yx2cygs7qjj-coreutils-8.32/bin/id"] bind_read_only = { - "/etc" = "/etc", "/nix" = "/nix", } } |