chore: document that flag parsing should be stopped via --

This commit is contained in:
Jose Diaz-Gonzalez committed 2024-01-23 03:00:27 -05:00
1 parent ba714c189f
commit 997f04afae
2 files changed
+13 -5

No files matched your search

+12 -4
View File
@@ -20,8 +20,9 @@ The `run` command can be used to run a one-off process for a specific command. T
> New as of 0.25.0, this container will be removed after the process exits. > New as of 0.25.0, this container will be removed after the process exits.
```shell ```shell
# runs `ls -lah` in the `/app` directory of the app `node-js-app` # runs `ls` in the `/app` directory of the app `node-js-app`
dokku run node-js-app ls -lah #
dokku run node-js-app ls
# optionally, run can be passed custom environment variables # optionally, run can be passed custom environment variables
dokku run --env "NODE_ENV=development" --env "PATH=/custom/path" node-js-app npm run mytask dokku run --env "NODE_ENV=development" --env "PATH=/custom/path" node-js-app npm run mytask
@@ -29,6 +30,13 @@ dokku run --env "NODE_ENV=development" --env "PATH=/custom/path" node-js-app npm
One off containers are removed at the end of process execution. One off containers are removed at the end of process execution.
If the custom command uses flags, it must be separated from the `dokku enter` command via `--` (double dashes):
```shell
# runs `ls -lah` in the `/app` directory of the app `node-js-app`
dokku run node-js-app -- ls -lah
```
#### Running Procfile commands #### Running Procfile commands
The `run` command can also be used to run a command defined in the app `Procfile`: The `run` command can also be used to run a command defined in the app `Procfile`:
@@ -58,7 +66,7 @@ dokku --label=com.example.test-label=value run node-js-app ls -lah
One-off containers default to interactive mode where possible. To disable this behavior, specify the `--no-tty` flag: One-off containers default to interactive mode where possible. To disable this behavior, specify the `--no-tty` flag:
```shell ```shell
dokku run --no-tty node-js-app ls -lah dokku run --no-tty node-js-app -- ls -lah
``` ```
### Running a detached container ### Running a detached container
@@ -69,7 +77,7 @@ dokku run --no-tty node-js-app ls -lah
Finally, a container can be run in "detached" mode via the `run:detached` Dokku command. Running a process in detached mode will immediately return a `CONTAINER_ID`. Detached containers are run without a tty and are also removed at the end of process execution. Finally, a container can be run in "detached" mode via the `run:detached` Dokku command. Running a process in detached mode will immediately return a `CONTAINER_ID`. Detached containers are run without a tty and are also removed at the end of process execution.
```shell ```shell
dokku run:detached node-js-app ls -lah dokku run:detached node-js-app -- ls -lah
# returns the ID of the new container # returns the ID of the new container
``` ```
+1 -1
View File
@@ -98,7 +98,7 @@ teardown() {
assert_output_contains "objects" assert_output_contains "objects"
assert_output_contains "refs" assert_output_contains "refs"
run /bin/bash -c "dokku enter $TEST_APP web test -d .git" run /bin/bash -c "dokku enter $TEST_APP web -- test -d .git"
echo "output: $output" echo "output: $output"
echo "status: $status" echo "status: $status"
assert_success assert_success