jesseduffield / jesseduffield/lazydocker
Hotkey for entering a running container's shell
- Dominant language
- Go
- Stars
- 52.8k
- Forks
- 1.7k
- PR merge metrics
- No merged PRs in 30d
Description
**Is your feature request related to a problem? Please describe.**
It is very useful to enter a running container's shell. A shortcut for this would be appreciated. I don't need this for myself as already have a workaround. I think it would be nice for others.
**Describe the solution you'd like**
A built-in hotkey that, when pressed on a service, enters the containers shell via `docker exec`.
**Describe alternatives you've considered**
Here is what I have in my config file:
```yaml
---
customCommands:
containers:
- name: shell
attach: true
command:
docker exec -it {{ .Container.ID }} sh -c 'for SH in $(echo bash sh); do if (eval $SH); then exit 0; fi; done || exit 1'
serviceNames: []
```
(My bash scripting skills is not something I boast about)
This way, pressing `c` on a running service gives me the "shell" option I can use to enter a container's shell.
**Additional context**
_If_ this were to be implemented and documented, a note that the service must be configured with `stdin_open` and `tty` in order for this to work would be helpful.
Contributor guide
Assessment
This issue has not been assessed yet.