mirror of
https://github.com/jesseduffield/lazydocker.git
synced 2026-07-21 23:01:03 +00:00
Exec shell: autodetect container shell
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 https://github.com/moby/moby/issues/41702
This commit is contained in:
parent
415b14fb10
commit
430600063c
2 changed files with 2 additions and 2 deletions
|
|
@ -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}}
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
},
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue