github.com/smintz/nomad@v0.8.3/website/source/docs/drivers/raw_exec.html.md (about) 1 --- 2 layout: "docs" 3 page_title: "Drivers: Raw Exec" 4 sidebar_current: "docs-drivers-raw-exec" 5 description: |- 6 The Raw Exec task driver simply fork/execs and provides no isolation. 7 --- 8 9 # Raw Fork/Exec Driver 10 11 Name: `raw_exec` 12 13 The `raw_exec` driver is used to execute a command for a task without any 14 isolation. Further, the task is started as the same user as the Nomad process. 15 As such, it should be used with extreme care and is disabled by default. 16 17 ## Task Configuration 18 19 ```hcl 20 task "webservice" { 21 driver = "raw_exec" 22 23 config { 24 command = "my-binary" 25 args = ["-flag", "1"] 26 } 27 } 28 ``` 29 30 The `raw_exec` driver supports the following configuration in the job spec: 31 32 * `command` - The command to execute. Must be provided. If executing a binary 33 that exists on the host, the path must be absolute. If executing a binary that 34 is downloaded from an [`artifact`](/docs/job-specification/artifact.html), the 35 path can be relative from the allocations's root directory. 36 37 * `args` - (Optional) A list of arguments to the `command`. References 38 to environment variables or any [interpretable Nomad 39 variables](/docs/runtime/interpolation.html) will be interpreted before 40 launching the task. 41 42 ## Examples 43 44 To run a binary present on the Node: 45 46 ``` 47 task "example" { 48 driver = "raw_exec" 49 50 config { 51 # When running a binary that exists on the host, the path must be absolute/ 52 command = "/bin/sleep" 53 args = ["1"] 54 } 55 } 56 ``` 57 58 To execute a binary downloaded from an [`artifact`](/docs/job-specification/artifact.html): 59 60 ``` 61 task "example" { 62 driver = "raw_exec" 63 64 config { 65 command = "name-of-my-binary" 66 } 67 68 artifact { 69 source = "https://internal.file.server/name-of-my-binary" 70 options { 71 checksum = "sha256:abd123445ds4555555555" 72 } 73 } 74 } 75 ``` 76 77 ## Client Requirements 78 79 The `raw_exec` driver can run on all supported operating systems. For security 80 reasons, it is disabled by default. To enable raw exec, the Nomad client 81 configuration must explicitly enable the `raw_exec` driver in the client's 82 [options](/docs/agent/configuration/client.html#options): 83 84 ``` 85 client { 86 options = { 87 "driver.raw_exec.enable" = "1" 88 } 89 } 90 ``` 91 92 ## Client Attributes 93 94 The `raw_exec` driver will set the following client attributes: 95 96 * `driver.raw_exec` - This will be set to "1", indicating the driver is available. 97 98 ## Resource Isolation 99 100 The `raw_exec` driver provides no isolation.