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
pull/247/head
Sergey Ponomarev 4 years ago
parent 415b14fb10
commit 430600063c

@ -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…
Cancel
Save