Skip to content

Commit

Permalink
Exec shell: autodetect container shell
Browse files Browse the repository at this point in the history
Some containers may have bash installed but some have only basic sh (Ash/Dash).
There is other shells too: ZSh, tsh etc.

We can automatically detect what shell is configured.
See explanation how it works moby/moby#41702
  • Loading branch information
stokito committed Dec 12, 2020
1 parent 415b14f commit 4306000
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/Config.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ customCommands:
containers:
- name: bash
attach: true
command: docker exec -it {{ .Container.ID }} /bin/sh
command: "docker exec -it {{ .Container.ID }} /bin/sh -c 'eval $(grep ^$(id -un): /etc/passwd | cut -d : -f 7-)'"
serviceNames: []
oS:
openCommand: open {{filename}}
Expand Down
2 changes: 1 addition & 1 deletion pkg/config/app_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ func GetDefaultConfig() UserConfig {
Containers: []CustomCommand{
{
Name: "bash",
Command: "docker exec -it {{ .Container.ID }} /bin/sh",
Command: "docker exec -it {{ .Container.ID }} /bin/sh -c 'eval $(grep ^$(id -un): /etc/passwd | cut -d : -f 7-)'",
Attach: true,
},
},
Expand Down

0 comments on commit 4306000

Please sign in to comment.