Skip to content

Commit

Permalink
document --user flag for exec
Browse files Browse the repository at this point in the history
  • Loading branch information
christophercampbell committed Jan 14, 2025
1 parent b038a5e commit 0c1df5f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion docs/docs/cli-reference/service-exec.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ slug: /service-exec
To run a specific shell command inside a service container, run:

```bash
kurtosis service exec $THE_ENCLAVE_IDENTIFIER $THE_SERVICE_IDENTIFIER 'COMMAND'
kurtosis service exec [--user $CONTAINER_USER] $THE_ENCLAVE_IDENTIFIER $THE_SERVICE_IDENTIFIER 'COMMAND'
```

where `$THE_ENCLAVE_IDENTIFIER` and the `$THE_SERVICE_IDENTIFIER` are [resource identifiers](../advanced-concepts/resource-identifier.md) for the enclave and service, respectively.

Optionally pass `--user` flag to `exec` with $CONTAINER_USER, to execute the command on the container as that user. This only works for the docker case, the kubernetes case will fail if used. Omitting `--user` will default to `root`.

The specified command should be appropriately quoted and will be passed as it is to the shell interpreter of the running service container.

If the command returns a non-zero exit code, Kurtosis CLI will print an error and also return a non-zero exit code.

0 comments on commit 0c1df5f

Please sign in to comment.