diff --git a/docs/docs/cli-reference/service-exec.md b/docs/docs/cli-reference/service-exec.md index c890c34553..27b7041a3d 100644 --- a/docs/docs/cli-reference/service-exec.md +++ b/docs/docs/cli-reference/service-exec.md @@ -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.