Skip to content

Commit ac559b7

Browse files
committed
add: readme
1 parent 172e5b7 commit ac559b7

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,25 @@ You can configure the following environment variables:
4242
export CONTAINER_BASE_PATH="/path/to/containers:/another/path"
4343
```
4444
Default paths include `/var/container` and `/srv/container`.
45+
You can limit the search depth with CONTAINER_BASE_PATH_MAX_DEPTH.
46+
```bash
47+
export CONTAINER_BASE_PATH="4"
48+
```
49+
Default depth is 2.
4550
- CONTAINER_EXEC_COMMAND
4651
Customize the execution command. Example:
4752
```bash
4853
export CONTAINER_EXEC_COMMAND="docker compose -f %COMPOSE exec --user root %SERVICE /bin/bash"
4954
```
5055
- `%COMPOSE` will be replaced with the path to the selected Compose file.
5156
- `%SERVICE` will be replaced with the selected service.
57+
- CONTAINER_EXEC_COMMAND_NOT_RUNNING
58+
Customize the execution command if the docker container is not running. Example:
59+
```bash
60+
export CONTAINER_EXEC_COMMAND_NOT_RUNNING="echo %COMPOSE %SERVICE is not running."
61+
```
62+
- `%COMPOSE` will be replaced with the path to the selected Compose file.
63+
- `%SERVICE` will be replaced with the selected service.
5264

5365
## Example
5466

@@ -84,6 +96,10 @@ Running `docker-compose-exec` will:
8496
```bash
8597
CONTAINER_EXEC_COMMAND="echo %COMPOSE %SERVICE" docker-compose-exec
8698
```
99+
- `CONTAINER_EXEC_COMMAND` will only be exec if docker compose service is running. If it is not runing `CONTAINER_EXEC_COMMAND_NOT_RUNNING` will be executed.
100+
```bash
101+
CONTAINER_EXEC_COMMAND_NOT_RUNNING="echo %COMPOSE %SERVICE is not running" docker-compose-exec
102+
```
87103
- You can set the maximum depth of the recursive search for Docker Compose files (default depth is 2).
88104
```bash
89105
CONTAINER_BASE_PATH_MAX_DEPTH="5" docker-compose-exec

0 commit comments

Comments
 (0)